ClojureDocs

Nav

Namespaces

set-error-mode!

clojure.core

Available since 1.2 (source)
  • (set-error-mode! a mode-keyword)
Sets the error-mode of agent a to mode-keyword, which must be
either :fail or :continue.  If an action being run by the agent
throws an exception or doesn't pass the validator fn, an
error-handler may be called (see set-error-handler!), after which,
if the mode is :continue, the agent will continue as if neither the
action that caused the error nor the error itself ever happened.

If the mode is :fail, the agent will become failed and will stop
accepting new 'send' and 'send-off' actions, and any previously
queued actions will be held until a 'restart-agent'.  Deref will
still work, returning the state of the agent before the error.