error-handler

added
1.2

ns
clojure.core

type
function

(error-handler a)

Returns the error-handler of agent a, or nil if there is none.
See set-error-handler!

                (def error-atom (atom []))

(def a (agent ""
              :validator string?
              :error-handler (fn [agnt ex]
                               (swap! error-atom
                                      conj
                                      {:agent agnt
                                       :exception (.getMessage ex)}))))

(send a 1) ;; will fail validation

@error-atom
[{:agent #<Agent@c47f284: "">,
  :exception "java.lang.Long cannot be cast to clojure.lang.IFn"}]

(error-handler a)
#<core$fn__11922 user$fn__11922@2a6b59c>