![]() Previous |
![]() Next |
When handling errors in nested programs, the error-handling section in each program should restore the environment. It can also handle any special error conditions that are particular to that program. For example, when your program signals its own error, then you can include statements that test for that error.
Any other errors that occur in a nested program should be passed up through the chain of programs and handled in each program. To pass errors through a chain of nested programs, you can use one of two methods, depending on when you want the error message to be produced:
The error message is produced immediately, and the error condition is then passed through the chain of programs as illustrated in Example: Producing a Program Error Message Immediately.
The error is passed through the chain of programs first, and the error message is produced at the end of the chain as illustrated inExample: Producing a Program Error Message at the End of the Chain.
A SIGNAL
statement is used in both methods.