From e006fbcbb0a5f2b27d3d30986ee53e0cf46ef867 Mon Sep 17 00:00:00 2001 From: kul Date: Thu, 10 Apr 2014 16:06:56 +0530 Subject: [PATCH] Expose exception to user as :throwable (@kul) --- src/taoensso/nippy.clj | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/taoensso/nippy.clj b/src/taoensso/nippy.clj index 75a9335..f2fd290 100644 --- a/src/taoensso/nippy.clj +++ b/src/taoensso/nippy.clj @@ -436,8 +436,9 @@ id-reader (let [edn (read-utf8 in)] (try (edn/read-string {:readers *data-readers*} edn) - (catch Exception _ {:nippy/unthawable edn - :type :reader}))) + (catch Exception e {:nippy/unthawable edn + :type :reader + :throwable e}))) id-serializable (let [class-name (read-utf8 in)] @@ -446,8 +447,9 @@ object (.readObject (ObjectInputStream. in)) ^Class class (Class/forName class-name)] (cast class object)) - (catch Exception _ {:nippy/unthawable class-name - :type :serializable}))) + (catch Exception e {:nippy/unthawable class-name + :type :serializable + :throwable e}))) id-bytes (read-bytes in) id-nil nil