kennethreitz/grequests — pull request #57 by natecode (2014-06-19 05:06:02+00:00)
Title: Differentiate HTTP errors like 404 from connection errors.

With the previous code, a 404 or other HTTP error would result in:

Traceback (most recent call last):
File "", line 1, in
File "dload.py", line 16, in download_urls
exception_handler=exception_handler):
File "/app/lib/python2.7/site-packages/grequests.py", line 148, in imap
exception_handler(request, request.exception)
AttributeError: 'AsyncRequest' object has no attribute 'exception'

This is because gevent didn't store the exception in the request because an HTTP error does not cause an exception. We're in this case though because request.response evaluates to False if the Response was an HTTP error.

Also, can we get a release soon? Version 0.20 is kinda lacking without connection error handling. Thanks.