Permalink
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...
1 parent b03af54 commit 674cc465ace083bc9362661a5448739f588aa178 @neotyk neotyk committed Mar 24, 2013
Showing with 6 additions and 3 deletions.
  1. +6 −3 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)

0 comments on commit 674cc46

Please sign in to comment.