(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>