{Begin Chapter Errors and Breaks}
{Title Errors and Breaks}
{Text


{Note Chapter Status:
Reorganized, revised

Changes needed:
(1) Examples (transcipts?)
(2) More information needed for inexperianced user who wants to know what to do about an error (perhaps should be in "how to use Interlisp" chapter).
(3) List of error messages should be moved out into an appendix, eventually}

Occasionally, while a program is running, an error may occur which stops the computation.  Errors can be caused in different ways.  A coding mistake may have caused the wrong arguments to be passed to a function, or caused the function to try doing something illegal.  For example, {fn PLUS} will cause an error if its arguments are not numbers.  It is also possible to interrupt a computation at any time by typing one of the "interrupt characters," such as control-D or control-E (the Interlisp-D interrupt characters are listed on {PageRef Term Interrupt Characters}).  Finally, the programmer can specify that certain functions automatically cause an error whenever they are entered (see {PageRef Tag BreakingFunctions}).  This facilitates debugging by allowing examination of the context within the computation.

When an error occurs, the system can either reset and unwind the stack, or go into a "break", an environment where the user can examine the state of the system at the point of the error, and attempt to debug the program.  The mechanism that decides whether to unwind the stack or break can be modified by the user, and is described on {PageRef Tag WhenToBreak} of this chapter.  Within a break, Interlisp offers an extensive set of "break commands" which assist with debugging.

This chapter explains what happens when errors occur.  It also tells the user how to handle program errors using breaks and break commands.  The debugging capabilities of break window facility are described, as well as the variables that control its operation.  Finally, advanced facilities for modifying and extending the error mechanism are presented.


{Include Breaks}

{Include ErrorFns}

{Include Resetvars}

{Include ErrorList}


}{End Chapter Errors and Breaks}