https://github.com/helins/ex.clj
Java exceptions as clojure data
https://github.com/helins/ex.clj
clojure data exception java java-exceptions
Last synced: 14 days ago
JSON representation
Java exceptions as clojure data
- Host: GitHub
- URL: https://github.com/helins/ex.clj
- Owner: helins
- License: epl-1.0
- Archived: true
- Created: 2018-01-24T12:33:22.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2018-06-15T10:03:26.000Z (over 7 years ago)
- Last Synced: 2025-10-12T15:27:00.255Z (2 months ago)
- Topics: clojure, data, exception, java, java-exceptions
- Language: Clojure
- Homepage: https://dvlopt.github.io/doc/dvlopt/ex/
- Size: 9.77 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ex
[](https://clojars.org/dvlopt/ex)
Describing java exceptions in clojure data structures is useful for a variety of
use cases such as logging or sharing exceptions over the network.
## Usage
Read the [API](https://dvlopt.github.io/doc/clojure/dvlopt/ex/index.html).
All functions are fully specified and checked with clojure.spec.
In short :
```clj
(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)
```
## License
Copyright © 2018 Adam Helinski
Distributed under the Eclipse Public License either version 1.0 or (at
your option) any later version.