Sometimes I need to interact with the base exception information on an ExceptionInfo (such as .setStackTrace
). The core function ex-info
doesn't type hint either arity, so to avoid reflection warnings, I must specify ^ExceptionInfo
when using the results of the call:
(let [old-ex (Exception. "asdf")
new-ex (ex-info "example" {})]
(doto ^ExceptionInfo new-ex (.setStackTrace (.getStackTrace old-ex))))
Adding type hints to ex-info
would neatly solve this for all such uses (including the uses in Clojure core, ex-data
etc).
I can create a patch if there's interest.