Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (ns my.CustomException
- (:gen-class :extends RuntimeException
- :implements [clojure.lang.IDeref]
- :constructors {[java.util.Map String] [String]
- [java.util.Map String Throwable] [String Throwable]}
- :init init
- :state info
- :methods [[getInfo [] java.util.Map]
- [addInfo [Object Object] void]]))
- (import 'my.CustomException)
- (defn -init
- ([info message]
- [message] (atom (into {} info)))
- ([info message ex]
- [message ex] (atom (into {} info))))
- (defn- -deref
- [^CustomException this]
- @(.info this))
- (defn- -getInfo
- [this]
- @this)
- (defn- -addInfo
- [^CustomException this key value]
- (swap! (.info this) assoc key value))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement