The 'errset' special form is a mechanism that allows the trapping of
errors within the execution of 'expr'.
*breakenable* must be set to
NIL for the 'errset' form to function. If
*breakenable* is
Errors from error and cerror and system errors will be handled by 'errset'. Note that the cerror message will only include the error message portion, not the continue message portion. break is not intercepted by 'errset'.
(setq *breakenable* nil) ; do not enter the break-loop on errors (errset (error "hi" "ho")) ; prints error: hi - "ho" returns NIL (errset (cerror "hi" "ho" "he")) ; prints error: ho - "he" returns NIL (errset (error "hey" "ho") NIL) ; returns NIL (errset (break "hey")) ; break: hey - if continued: return from BREAK (continue) ; [ continue from break loop ] (errset (+ 1 5)) ; returns (6) (errset (+ 1 "a") NIL) ; returns NIL (setq *breakenable* t) ; re-enable the break-loop on errors
Note: Be sure to set
*breakenable* to
NIL before using 'errset' and to
non-NIL after using 'errset'. If you don't
reset
See the
errset
function in the