Skip to content

Commit

Permalink
Handle response only if not already dealt with
Browse files Browse the repository at this point in the history
  • Loading branch information
kauwai committed Jul 15, 2024
1 parent cb2e62b commit 219a9f6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion http/json-codec/project.clj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
(defproject house.jux/http.json-codec "2024.06.20"
(defproject house.jux/http.json-codec "2024.07.15"

:description "Wrapper that handles API thrown exceptions with a 400 status code."
:url "https://github.com/klauswuestefeld/simple-clj/tree/master/http/json-codec"
Expand Down
4 changes: 3 additions & 1 deletion http/json-codec/src/house/jux__/http/json_codec__.clj
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,6 @@
(fn [request]
(let [request (update request :body decode-if-necessary)
response (delegate request)]
(update response :body pipe-json-if-necessary))))
(if (:handled response)
response
(update response :body pipe-json-if-necessary)))))

0 comments on commit 219a9f6

Please sign in to comment.