Executes a body of code across action lists and items, signaling errors and then continuing to the next action item.
lispworks
with-action-item-error-handling action-list-var action-item-var ignore-errors-p &body body
action-list-var⇩ |
A variable. |
action-item-var⇩ |
A variable. |
ignore-errors-p⇩ |
A boolean. |
body⇩ |
A body of Lisp code. |
The macro with-action-item-error-handling
executes body with action-list-var and action-item-var are bound to the action list and item respectively. If ignore-errors-p is set to t
then errors are handled. The behavior of the handler is to signal a warning in which the action-list, item and original error are all reported; execution then continues with the next action-item.
(defun my-execution-function (the-action-list other-args &key ignore-errors-p &allow-other-keys) (with-action-list-mapping (the-action-list an-action-item action-item-data) (with-action-item-error-handling (the-action-list an-action-item ignore-errors-p) (do-something-interesting-first) (apply (car action-item-data) other-args (cdr action-item-data)))))
If this function was invoked with the keyword argument :ignore-errors-p t
, and an error was signaled while executing the body-form(s) for one of the action-items, then a warning such as:
Warning: Got an error 'The variable *PREV-STATE* is unbound.' while executing action "Initialize State" in list "Startup Inits".
would be signaled and execution would continue with the next action-item.
LispWorks® User Guide and Reference Manual - 01 Dec 2021 19:30:41