[Return to Bookshelf] [Contents] [Previous Section] [Next Section] [Index] [Help]


5.2.3 Defining a Code Region to Catch Exceptions

The TRY macro defines the beginning of an exception scope, and the ENDTRY macro defines the end of the scope. These macros allow the programmer to define a scope (a block) wherein exceptions can be caught. Any exceptions raised within the block, or within any functions that are called directly or indirectly by the block, pass through the control of this scope. These exceptions can be caught and reraised if it is desirable to continue propagation, or ignored which implicitly reraises them.

Following is an example of defining an exception-handling region without indicating any recovery actions:

TRY {
   read_tape ();
}
ENDTRY