NET/MASTER Network Control Language (NCL) Programmer's Guide
Writing an Error Handler
Run-Time Error Handling
106160 Tandem Computers Incorporated 7–9
Specifying Alternative Actions Using Different Error Handlers
When you use more than one error handler, you can use each to direct NCL to
perform different actions. The following example shows an NCL procedure that traps
arithmetic errors in the ARITH_ERROR error handler, type errors in the TYPE_ERROR
error handler, and all other errors in the ERROR error handler:
zex0705n: PROCEDURE
 /* Specifying more than one error handler */
 ON ERROR DO
 SAY Unexpected error
 CALL generror
 FLUSH
 END
 ON ARITH_ERROR DO
 SAY Arithmetic error
 CALL generror
 FLUSH
 END
 ON TYPE_ERROR DO
 SAY Type error
 CALL generror
 FLUSH
 END
 generror: PROCEDURE
 /* ERROR handler */
 SAY "Condition is "&SYS.ERROR.COND
 SAY "Code is "&SYS.ERROR.CODE
 SAY "Procedure library is "&SYS.ERROR.LIB
 SAY "Proc/Func is "&SYS.ERROR.PROCNAME
 end generror
 SAY &1" to the power of "&2" is "&1**&2
 SAY Normal termination
END zex0705n










