All exceptions generated within the scripting engine obey the rules of TCL. Therefore, the script writer should consult the TCL documentation to fully understand the syntax of exception handling.
If the script writer wishes to start an operation after a global abort has been issued, there are two commands for doing this:
start_recovery_operation operationName [arg1 [arg2 [arg3 [...]]]]
start_waitable_recovery_operation operationName [arg1 [arg2 [arg3 [...]]]]
These two functions behave the same as the start_operation
and the
start_waitable_operation
commands, except that they bypass the
check for the global abort flag.
These functions can be used to start operations that are needed in order to recover from a bad state.
For example, the collectRun operation interfaces with a Q4 CCD detector.
The Q4 CCD detector should not flush its buffer after every image, because
this would eliminate the double buffer capability of the detector.
However, if an exception happens within the script somewhere, the detector
must flush its buffer before the script is completed. Therefore
the collectRun operation catches all exceptions, and starts the
recovery operation detector_stop
before throwing the original exception
again.