Skip to content

Commit

Permalink
Include exception cause in ex-info (#285)
Browse files Browse the repository at this point in the history
This ensures that the full stack trace of errors will be preserved.
  • Loading branch information
danielcompton authored and malcolmsparks committed Apr 16, 2019
1 parent c69c003 commit cea98cc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/yada/interceptors.clj
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@
(try
(Long/parseLong len)
(catch Exception e
(throw (ex-info "Malformed Content-Length" {:value len})))))))
(throw (ex-info "Malformed Content-Length" {:value len} e)))))))

(defn get-properties
[ctx]
Expand Down
8 changes: 5 additions & 3 deletions src/yada/methods.clj
Original file line number Diff line number Diff line change
Expand Up @@ -191,9 +191,11 @@
(fn [e]
(if (:status (ex-data e))
(throw e)
(throw (ex-info "Error on GET" {:response (:response ctx)
:resource (type (:resource ctx))
:error e}))))))))
(throw (ex-info "Error on GET"
{:response (:response ctx)
:resource (type (:resource ctx))
:error e}
e))))))))

;; --------------------------------------------------------------------------------

Expand Down

0 comments on commit cea98cc

Please sign in to comment.