OpenSTA logo OpenSTA SCL Reference
ON ERROR Command

ON ERROR Command

This command allows Script errors - which would normally cause the thread being executed to abort - to be captured, and Script execution to be resumed at a predefined label. The ON ERROR handler is global to all sections of the Script; it is propagated into all called subroutines and Scripts.

The ON ERROR command captures any errors which occur either in the Script within which it was declared or within any lower level Scripts called by it. All Script errors, such as a bad parameter error on the ~EXTRACT command, or an attempt to call a nonexistent Script, may be intercepted and dealt with by this command.

If a Script error is encountered, then a message will be written to the audit log, identifying and locating where the error occurred. If the error has occurred in a Script at a lower level than that within which the ON ERROR command was declared, then all Scripts will be aborted until the required Script is found.

An ON ERROR handler may be overridden by the ON ERROR GOTO or ON TIMEOUT GOTO clause for the duration of a single command. It may also be overridden by the ON ERROR command within a called Script or subroutine; such a modification will affect only those Scripts and subroutines at that nesting level or lower. On exit from the Script or subroutine, the previously defined ON ERROR handler will be re-established.

When ON ERROR checking is established, it can be disabled by using the CANCEL command.

Command Definition:

ON ERROR GOTO label

label

A label defined within the current scope of the Script to which control branches if an error occurs.

Example:

ON ERROR GOTO SCRIPT_ERR

<<<
prev page
^^^
section start
>>>
next page