Welcome! Please see the About page for a little more info on how this works.

0 votes
in Clojure by

If I pass a function containing start-agent to set-error-handler of an agent, if an exception occurs the restart-agent is ignored.
for example:

(def a (agent 0))

(set-error-handler! a (fn (link: the-agent the-exception) (restart-agent the-agent)) )

If I now issue : (send! a #(/ 1 0)), I still have a failed agent. It did not restart.

I know I can set the error-mode to the agent to :continue to have my agent up after a crash, but I wished I could fix the conditions that caused the exception in the first-place then restart the agent programmatically in the set-error-handler.

Maybe it is a known beahviour, but then it is not documented ?

1 Answer

0 votes
by
Reference: https://clojure.atlassian.net/browse/CLJ-1428 (reported by turbopape)
...