Definition macro
Defines a "last-handler" to be used after any dynamic handlers and before calling default-handler.
define last-handler (condition, #key test, init-args) = handler;
define last-handler condition = handler;
define last-handler;
None.
common-extensions
common-extensions
A last-handler is a global form of the dynamic handler introduced via let handler, and is defined using an identical syntax. The last handler is treated as a globally visible dynamic handler. During signalling if a last-handler has been installed then it is the last handler tested for applicability before default-handler is invoked. If a last-handler has been installed then it is also the last handler iterated over in a call to do-handlers.
The first two defining forms are equivalent to the two alternate forms of let handler. If more than one of these first defining forms is executed then the last one executed determines the installed handler. The current last-handler can be uninstalled by using the degenerate third case of the defining form, that has no condition description or handler function.
The intention is that libraries will install last handlers to provide basic runtime error handling, taking recovery actions such as quitting the application, trying to abort the current application operation, or entering a connected debugger.
The following form defines a last-handler function called default-last-handler that is invoked on conditions of class <serious-condition>:
define last-handler <serious-condition> = default-last-handler;
win32-last-handler in the C FFI and Win32 library reference, under library win32-user and module win32-default-handler.