Describing java exceptions in clojure data structures is useful for a variety of use cases such as logging or sharing exceptions over the network.
Read the API.
All functions are fully specified and checked with clojure.spec.
In short :
(require '[dvlopt.ex :as ex])
;; An exception with a cause, the kind of thing you can catch
(def example-exception
(Exception. "Something bad happened"
(ex-info "Takes into account clojure's ExceptionInfo"
{:some :data})))
;; Now, let us translate this exception into pure data
(ex/exception example-exception)
Copyright © 2018 Adam Helinski
Distributed under the Eclipse Public License either version 1.0 or (at your option) any later version.