Skip to content

Commit

Permalink
Add ex-data to http-exception
Browse files Browse the repository at this point in the history
kauwai committed Jun 24, 2024
1 parent 3fac03d commit 5c53bd3
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion http/exceptions/project.clj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
(defproject house.jux/http.exceptions "2024.06.11"
(defproject house.jux/http.exceptions "2024.06.24"

:description "Wrapper that handles API thrown exceptions with a 400 status code."
:url "https://github.com/klauswuestefeld/simple-clj/tree/master/http/exceptions"
6 changes: 3 additions & 3 deletions http/exceptions/src/house/jux__/http/exceptions__.clj
Original file line number Diff line number Diff line change
@@ -4,9 +4,9 @@
[house.jux--.exceptions-- :refer [message expected?]]))

(defn- ->body [e message expected?]
(if expected?
{:error message, :expected true}
{:error message, :stacktrace (with-out-str (stacktrace/print-cause-trace e))}))
(merge (if expected?
{:error message, :expected true}
{:error message, :stacktrace (with-out-str (stacktrace/print-cause-trace e))}) (ex-data e)))


(defn handle [delegate-handler request]

0 comments on commit 5c53bd3

Please sign in to comment.