diff --git a/README.md b/README.md index fa7aac5..7f10b79 100644 --- a/README.md +++ b/README.md @@ -90,7 +90,12 @@ nippy/stress-data :uuid (java.util.UUID/randomUUID) :date (java.util.Date.) - :stress-record (->StressRecord "data")} + :stress-record (->StressRecord "data") + + ;; Serializable + :throwable (Throwable. "Yolo") + :exception (try (/ 1 0) (catch Exception e e)) + :ex-info (ex-info "ExInfo" {:data "data"})} ``` Serialize it: diff --git a/src/taoensso/nippy.clj b/src/taoensso/nippy.clj index c2deb0f..1d5cb58 100644 --- a/src/taoensso/nippy.clj +++ b/src/taoensso/nippy.clj @@ -481,7 +481,12 @@ :uuid (java.util.UUID/randomUUID) :date (java.util.Date.) - :stress-record (->StressRecord "data")})) + :stress-record (->StressRecord "data") + + ;; Serializable + :throwable (Throwable. "Yolo") + :exception (try (/ 1 0) (catch Exception e e)) + :ex-info (ex-info "ExInfo" {:data "data"})})) ;;;; Deprecated API diff --git a/test/taoensso/nippy/tests/main.clj b/test/taoensso/nippy/tests/main.clj index 4d98a57..8435112 100644 --- a/test/taoensso/nippy/tests/main.clj +++ b/test/taoensso/nippy/tests/main.clj @@ -5,7 +5,7 @@ [taoensso.nippy.benchmarks :as benchmarks])) ;; Remove stuff from stress-data that breaks roundtrip equality -(def test-data (dissoc nippy/stress-data :bytes)) +(def test-data (dissoc nippy/stress-data :bytes :throwable :exception :ex-info)) (defn- before-run {:expectations-options :before-run} []) (defn- after-run {:expectations-options :after-run} [])