Catch socket.gaierror in safe mode.

This commit is contained in:
Cory Benfield
2012-08-02 12:16:41 +01:00
parent 55237ad67d
commit 4f40b3befc
+2 -1
View File
@@ -28,7 +28,8 @@ def catch_exceptions_if_in_safe_mode(function):
and kwargs.get('session').config.get('safe_mode')):
try:
return function(method, url, **kwargs)
except (RequestException, ConnectionError, HTTPError, socket.timeout) as e:
except (RequestException, ConnectionError, HTTPError,
socket.timeout, socket.gaierror) as e:
r = Response()
r.error = e
r.raw = HTTPResponse() # otherwise, tests fail