ex-info

added
1.4

ns
clojure.core

type
function

(ex-info msg map) (ex-info msg map cause)

Create an instance of ExceptionInfo, a RuntimeException subclass
that carries a map of additional data.

                (try
  (throw 
    (ex-info "The ice cream has melted!" 
       {:causes             #{:fridge-door-open :dangerously-high-temperature} 
        :current-temperature {:value 25 :unit :celsius}}))
  (catch Exception e (ex-data e)))

;;=> {:causes #{:fridge-door-open :dangerously-high-temperature} 
;;    :current-temperature {:value 25 :unit :celsius}}))