Next: Using condition-case to Trap and Handle Errors with Handlers, Previous: Error Signaling, Up: Errors—Unintentional Nonlocal Exits [Index]
signal
condition-case
function
When an ‘error’ is signaled, signal
searches for an active handler for
the ‘error’ (next).
a sequence of Lisp expressions designated to be executed if an error happens in part of the Lisp program.
If the ‘error’ has an applicable handler, the handler is executed, and
control resumes following the handler. The handler executes in the
environment of the condition-case
that established it; all functions called
within that condition-case
have already been exited, and the handler cannot
return to them.
If there is no applicable handler for the ‘error’, it terminates the current command and returns control to the editor command loop. The command loop’s handler uses the ‘error’ symbol and associated data to print an error message.
An error that has no explicit handler may call the Lisp debugger. The debugger
is enabled if the variable debug-on-error
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’.
This variable, if non-‘nil’, specifies a function to use to handle errors that return control to the Emacs command loop. The function should take three arguments:
condition-case
would bind to its
variable;