Closed canassa closed 12 years ago
Please check connection timeout test and request timeout tests.
Your code should be:
(defn get-user-page []
(with-open [client (c/create-client :compression-enabled true)]
(let [response (c/GET client URL)]
(c/await response)
(if-let [err (c/error response)]
(do
(println "failed processing request: " err)
(get-user-page))
(java.io.StringReader. (c/string response))))))
Thank you!
I am writing a web crawler using the http.async.client but I am having some intermittent issues when parsing the response
In my application there is a get-user-user function similar to this:
The problem is that sometimes it raises this exception:
So I wrapped the
(c/string response)
in a try catch block:And this was what the println printed:
It seems that the c/string call is returning
nil
and that causing the exception. What I don't get is why it happens since I am already checking for errors before calling c/string. Am I doing something wrong?Thanks, Cesar Canassa