ClojureScriptify Exceptions

This commit is contained in:
Tommi Reiman 2017-11-26 22:04:51 +02:00
parent 7979c9de9d
commit 132240b422

View file

@ -172,10 +172,10 @@
([request]
(try
(handler request)
(catch Exception e
(catch #?(:clj Exception :cljs js/Error) e
(handle-coercion-exception e identity #(throw %)))))
([request respond raise]
(try
(handler request respond (fn [e] (handle-coercion-exception e respond raise)))
(catch Throwable e
(catch #?(:clj Exception :cljs js/Error) e
(handle-coercion-exception e respond raise))))))))}))