next up previous contents 5
Next: Adding Scripts to the Up: Exception Handling Previous: Throwing your own exceptions   Contents

Writing specialized exception handlers

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:

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.


next up previous contents 5
Next: Adding Scripts to the Up: Exception Handling Previous: Throwing your own exceptions   Contents
Scott McPhillips 2011-07-06