Expose exception to user as :throwable
This commit is contained in:
parent
ccca7126a2
commit
af8e47d4ff
1 changed files with 7 additions and 5 deletions
|
|
@ -436,8 +436,9 @@
|
||||||
id-reader
|
id-reader
|
||||||
(let [edn (read-utf8 in)]
|
(let [edn (read-utf8 in)]
|
||||||
(try (edn/read-string {:readers *data-readers*} edn)
|
(try (edn/read-string {:readers *data-readers*} edn)
|
||||||
(catch Exception _ {:nippy/unthawable edn
|
(catch Exception e {:nippy/unthawable edn
|
||||||
:type :reader})))
|
:type :reader
|
||||||
|
:throwable e})))
|
||||||
|
|
||||||
id-serializable
|
id-serializable
|
||||||
(let [class-name (read-utf8 in)]
|
(let [class-name (read-utf8 in)]
|
||||||
|
|
@ -446,8 +447,9 @@
|
||||||
object (.readObject (ObjectInputStream. in))
|
object (.readObject (ObjectInputStream. in))
|
||||||
class ^Class (Class/forName class-name)]
|
class ^Class (Class/forName class-name)]
|
||||||
(cast class object))
|
(cast class object))
|
||||||
(catch Exception _ {:nippy/unthawable class-name
|
(catch Exception e {:nippy/unthawable class-name
|
||||||
:type :serializable})))
|
:type :serializable
|
||||||
|
:throwable e})))
|
||||||
|
|
||||||
id-bytes (read-bytes in)
|
id-bytes (read-bytes in)
|
||||||
id-nil nil
|
id-nil nil
|
||||||
|
|
@ -551,7 +553,7 @@
|
||||||
nil nil
|
nil nil
|
||||||
:aes128-sha512 aes128-encryptor
|
:aes128-sha512 aes128-encryptor
|
||||||
:no-header (throw (ex-info ":auto not supported on headerless data." {}))
|
:no-header (throw (ex-info ":auto not supported on headerless data." {}))
|
||||||
:else (throw (ex-info ":auto not supported for non-standard encryptors."))
|
:else (throw (ex-info ":auto not supported for non-standard encryptors." {}))
|
||||||
(throw (ex-info (format "Unrecognized :auto encryptor id: %s" encryptor-id)
|
(throw (ex-info (format "Unrecognized :auto encryptor id: %s" encryptor-id)
|
||||||
{:encryptor-id encryptor-id}))))
|
{:encryptor-id encryptor-id}))))
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue