120
ERROR_HANDLER Directive
Define Generic Handler
Formats
Where:
;entry$
Optional entry label in the error-trapping program. Define once per session.
prog$
Name of the error-trapping program. String expression. Omit the name
to cancel the current error handler.
var$
String variable. Receives the name of the current error handler.
Description
Use the ERROR_HANDLER directive to assign a generic error-handling program to be
invoked internally by the system whenever an error occurs that is not already
handled (i.e., by an ERR= statement reference or a SETERR directive). If the system is
unable to properly load and execute the specified error-handling program, ProvideX
will display Error #54: Unable to Load Error Handler.
See Also
Format 1: Define/Remove Generic Handler
ERROR_HANDLER [prog$]
This defines an error-handling program to take corrective action and then return to
the offending statement via an EXIT directive. If you have an error handler program
in place when an error occurs without handling instructions, ProvideX calls this
program to deal with it.
If you use an EXIT ERR directive to return from the error-handling program, the normal
error processor is invoked and control can be transferred to Command mode.
To cancel the current error handler, omit the program name (i.e., use
ERROR_HANDLER). The error handler program remains in effect until a START
directive is executed. The following is a typical START_UP program:
0010
PREFIX "===/ MISC/"
0020
IF WHO<>"BOSS" THEN SETESC OFF
0030
ERROR_HANDLER "*ERROR"
0040
! The asterisk marks "*ERROR" as a Sage Software Canada Ltd. utility
Format 2: Find Current Name
ERROR_HANDLER READ var$
Use the READ format to find out the name of the program currently in effect as the
error handler; e.g.,
-:ERROR_HANDLER READ A$
-:?a$
*error