linkedin / pyexchange

Python wrapper for Microsoft Exchange
Apache License 2.0
152 stars 98 forks source link

not all requests exception have a "response" object #40

Closed deronnax closed 9 years ago

deronnax commented 9 years ago

[...] File "/home/mdupuy/dev/pyexchange/pyexchange/base/soap.py", line 65, in _send_soap_request response = self.connection.send(body, headers, retries, timeout) File "/home/mdupuy/dev/pyexchange/pyexchange/connection.py", line 68, in send log.debug(err.response.content) AttributeError: 'NoneType' object has no attribute 'content'

For all error that occur before server response, like connectivity error and some other else, RequestException does not have a response attribute. Maybe use something else like requests.Exception.message, which always contains the reason of the error, whatever is the faulty layer.

deronnax commented 9 years ago

ooups, duplicate of #38. I close it as a duplicate but I strongly suggest that you use my suggestion for fixing it :)

catermelon commented 9 years ago

Thanks for the hint, I appreciate it. :) I'll take a look.