ex-info & ex-data
; ex-info creates an instance of ExceptionInfo, a RuntimeException subclass
; that carries a map of additional data.
(defn div [x]
(try
(/ 3 x)
(catch Exception e
(throw (ex-info (.getMessage e) {:x x})))))
; ex-data returns exception map data from ExceptionInfo instance
(try
(div 0)
(catch Exception e
(prn (.getMessage e)) ; "Divide by zero"
(prn (ex-data e)) ; {:x 0}
))