cch1 / http.async.client

Async Http Client - Clojure
http://cch1.github.com/http.async.client
267 stars 40 forks source link

Uncaught exception in :error function hangs http/await #52

Closed candera closed 9 years ago

candera commented 11 years ago

This code hangs forever:

(let [client (http/create-client :request-timeout 1500
                                 :connection-timeout 1000)
      req (http-request/prepare-request
           :get "http://nosuch.server/")
      resp (http-request/execute-request
            client
            req
            :error (fn [_ _] (throw (Exception. "boom!"))))]
  (http/await resp))

It appears that the exception in the :error function eliminates any chance of the underlying promise ever being delivered. It would be nice if http.async.client would protect against bugs in the :error function.

neotyk commented 11 years ago

Thanks for the bug report. I've pushed v0.5.3-SNAPSHOT to clojars. Please test it and let me know if it works for you.

cch1 commented 9 years ago

This bug is fixed in version 0.5.3 and later.