Recovering from Session Failure

There are two instances in which an LUA session has been closed due to an error:
  • When an LUA verb completes with the primary return code LUA_SESSION_FAILURE, or
  • When an LUA verb, after RUI_INIT completes successfully, completes with the primary return code LUA_STATE_CHECK and with the secondary return code LUA_NO_RUI_SESSION.

The session can often be reconstructed. LUA will attempt recovery if your program requests it.

When your program receives an LUA session closed due to an error, it should do the following if it wants to recover:
  • Avoid closing the session; the session is already closed.
  • Reopen the session using the verb originally used to open the session (RUI_INIT). If this verb completes with a nonzero primary return code, the session cannot be restarted at this time.
  • Notify the interactive user when recovery is underway, because the recovery might take some time. The state of the user's work will depend on the design of the PLU application.