Skip to content

Commit 9d916d5

Browse files
committed
Simplify wrap-exceptions
1 parent 0d8d190 commit 9d916d5

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

src/compojure/api/middleware.clj

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,13 +58,12 @@
5858
(handler request)
5959
(catch Throwable e
6060
(let [{:keys [type] :as data} (ex-data e)
61-
type (or (get ex/legacy-exception-types type) type)]
61+
type (or (get ex/legacy-exception-types type) type)
62+
handler (or (get handlers type) default-handler)]
6263
; FIXME: Used for validate
6364
(if (rethrow-exceptions? request)
6465
(throw e)
65-
(if-let [handler (get handlers type)]
66-
(call-error-handler handler e data request)
67-
(call-error-handler default-handler e data request)))))))))
66+
(call-error-handler handler e data request))))))))
6867

6968
;;
7069
;; Component integration

0 commit comments

Comments
 (0)