Porovnávané verzie

Kľúč

  • Tento riadok sa pridal
  • Riadok je odstránený.
  • Formátovanie sa zmenilo.

...

ON ERROR action sets a behaviour behavior of the script interpreter when an error occurs, as follows:

...

ON ERROR Label - the setting of an error handler. If an error occurs, the script will not be terminated, but the interpreter will jump to the given label. The predefined local variables _ERR_NR, _ERR_MSG, and _ERR_LINE automatically get the error description before the jump. Within the error handler, it is allowed to perform the actions RETRY (repeated execution of the action that caused the error) or RESUME (the script proceeds in execution after the action that caused the error). The label must be placed in the same procedure as the action (or in the initialization part).

ON ERROR OFF - if an error occurs, the processing sequence of actions is not interrupted and the local variables _ERR_NR, _ERR_MSG a , and _ERR_LINE are adjusted. Testing of _ERR_NR may detect and handle the error. In this mode, the access to the variable _ERR_NR (value reading) will set this variable to _ERR_NO_ERROR value. The object will be reopened.

ON ERROR ON - recovery of the error handling state that was valid before the ON ERROR OFF action.

Note:
A change of error behaviour behavior setting is valid only within the particular code section (procedure,...). If the action is used in a procedure, changes in the setting are cancelled canceled after its termination and set to the state defined before the procedure was called.

...

PROCEDURE Proc
 IF 1 THEN     ; error occurs here
  RETURN
 ENDIF
END Proc


BEGINN
 ON ERROR ErrorHandler

 CALL Proc
END
ErrorHandler:
END

Error An error that occurs in the procedure Proc will terminate it. Since the error is not handled, the error acts as if it occurred during the execution of the action CALL Proc and thus ErrorHandler will be called.

...

An error that occurs in the Proc procedure will cause jumping to ErrorHandlerProc. Since the error is handled, the procedure will be normally terminated and ErrorHandler will not be called.

Error status is described by the line number where the error occurred (from the view of the ESL script that forms the error description), error code (Error codes), and detail detailed error description in some cases.

The above-mentioned is followed by a complete call dump (CALL action) by which the action (ended by error) was performed. Detail description of the call dump is mentioned in the description of the %GetCallChain function.

...