Exception Handling Facilities
Exception Handling Facilities
The GT.M exception trapping allows you to do the following:
- DO a recovery routine and resume the original command stream.
- GOTO any special handling; an extended ZGOTO provides for context management.
- Report an error and enter Direct Mode for debugging.
- OPEN Input/Output devices with specific traps in addition to the main trap.
- Trap and process an exception based on a device error.
- Trap and process an exception based on terminal input.
The following table summarizes the GT.M language extensions that facilitate exception handling.
| GT.M Exception Handling Extensions | |
|---|---|
| EXTENSION | EXPLANATION |
| ZGoto | Removes zero or more levels from the M Invocation stack and, optionally, transfers control. |
| ZMessage | Signals the specified condition. |
| $ZCSTATUS | Holds the value of the status code for the last compile performed by a ZCOMPILE, ZLINK or auto-ZLINK. |
| $ZEOF | Contains indication of whether the last READ reached end-of-file. |
| $ZMessage() | Translates an error condition code into text form. |
| $ZLevel | Contains current level of DO/XECUTE nesting. |
| $ZStatus | Contains error condition code and location of last exception condition occurring during routine execution. |
| $ZSYstem | Contains the status code of the last ZSYSTEM. |
| $ZTrap | Contains an XECUTE string or entryref that GT.M invokes upon encountering an exception condition. |
| EXCEPTION | Provides a deviceparameter specifying an XECUTE string or entryref that GT.M invokes upon encountering a device-related exception condition. |