Directives
ERROR_HANDLER Define Generic Handler
   
Formats 1. Define/Remove Generic Handler: ERROR_HANDLER [prog$ ]

2. Find Current Name: ERROR_HANDLER READ var$

Where:

prog$ Name of the error handler program. String expression. A null string ("") will cancel the current error handler.

If desired a optional entry label within the error handler program may be specified as in "Myerr;ErrTrap".

var$ String variable. Receives the name of the current error handler.
Description Use the ERROR_HANDLER directive to assign a generic error-trapping 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 START Restart ProvideX.
   
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 Best 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