3.8 Error Handling

ERROR(NUMBER:integer, MESSAGE:any) eval, spread
 
NUMBER and MESSAGE are passed back to a surrounding ERRORSET (the Standard LISP reader has an ERRORSET). MESSAGE is placed in the global variable EMSG!* and the error number becomes the value of the surrounding ERRORSET. FLUID variables and local bindings are unbound to return to the environment of the ERRORSET. Global variables are not affected by the process.

ERRORSET(U:any, MSGP:boolean, TR:boolean):any eval, spread
 
If an error occurs during the evaluation of U, the value of NUMBER from the ERROR call is returned as the value of ERRORSET. In addition, if the value of MSGP is non-NIL, the MESSAGE from the ERROR call is displayed upon both the standard output device and the currently selected output device unless the standard output device is not open. The message appears prefixed with 5 asterisks. The MESSAGE list is displayed without top level parentheses. The MESSAGE from the ERROR call will be available in the global variable EMSG!*. The exact format of error messages generated by Standard LISP functions described in this document are not fixed and should not be relied upon to be in any particular form. Likewise, error numbers generated by Standard LISP functions are implementation dependent.

If no error occurs during the evaluation of U, the value of (LIST (EVAL U)) is returned.

If an error has been signaled and the value of TR is non-NIL a traceback sequence will be initiated on the selected output device. The traceback will display information such as unbindings of FLUID variables, argument lists and so on in an implementation dependent format.