Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Test describing behavior for throwing exceptions from error handler.

As described in #52.
Fixes #52.

If error handler throws exception this exception is delivered in
:error slot of response.
  • Loading branch information...
commit 674cc465ace083bc9362661a5448739f588aa178 1 parent b03af54
@neotyk neotyk authored
Showing with 6 additions and 3 deletions.
  1. +6 −3 src/clj/http/async/client/request.clj
View
9 src/clj/http/async/client/request.clj
@@ -277,9 +277,12 @@
(^{:tag void}
onThrowable [this #^Throwable t]
(do
- (deliver (:error resp) ((or error
- (:error *default-callbacks*))
- resp t))
+ (deliver (:error resp) (try
+ ((or error
+ (:error *default-callbacks*))
+ resp t)
+ (catch Throwable e
+ e)))
(when-not (realized? (:done resp))
(deliver (:done resp) true))))))]
(with-meta resp {:started (System/currentTimeMillis)
Please sign in to comment.
Something went wrong with that request. Please try again.