agent-error

clojure.core

  • (agent-error a)
Returns the exception thrown during an asynchronous action of the
agent if the agent is failed. Returns nil if the agent is not
failed.

1 Example top

  • (def tdate (agent (java.util.Date.)))
    
    @tdate
    => #<Date Wed Feb 15 23:25:26 CET 2012>
    
    (send tdate inc) ;;this has no meaning, rendering a (silent) error
    
    (agent-error tdate)
    => #<ClassCastException java.lang.ClassCastException: java.util.Date cannot be cast to java.lang.Number>
Log in to add / edit an example.

See Also top

Log in to add a see also.

Plus_12x12 Minus_12x12 Source clojure/core.clj:1936 top

(defn agent-error
  "Returns the exception thrown during an asynchronous action of the
  agent if the agent is failed.  Returns nil if the agent is not
  failed."
  {:added "1.2"
   :static true}
  [^clojure.lang.Agent a] (.getError a))
Vars in clojure.core/agent-error:
Used in 0 other vars

Comments top

No comments for agent-error. Log in to add a comment.