(lispref.info)Processing of Errors
Next: Handling Errors Prev: Signaling Errors Up: Errors
How Emacs Processes Errors
When an error is signaled, Emacs searches for an active "handler"
for the error. A handler is a specially marked place in the Lisp code
of the current function or any of the functions by which it was called.
If an applicable handler exists, its code is executed, and control
resumes following the handler. The handler executes in the environment
of the `condition-case' which established it; all functions called
within that `condition-case' have already been exited, and the handler
cannot return to them.
If no applicable handler is in effect in your program, the current
command is terminated and control returns to the editor command loop,
because the command loop has an implicit handler for all kinds of
errors. The command loop's handler uses the error symbol and associated
data to print an error message.
When an error is not handled explicitly, it may cause the Lisp
debugger to be called. The debugger is enabled if the variable
`debug-on-error' (Note: Error Debugging.) is non-`nil'. Unlike error
handlers, the debugger runs in the environment of the error, so that
you can examine values of variables precisely as they were at the time
of the error.
automatically generated by info2www