request: catch socket.error

socket.error is another exception which is thrown by the underlying
infrastacture and not handled by the urllib2 or httplib layers

fixes #236
This commit is contained in:
Noam Meltzer 2016-04-16 19:09:45 +03:00
parent a9b305edd0
commit ecc86d4bcd

View file

@ -106,6 +106,9 @@ def _try_except_req(func):
except HTTPException as error:
raise NetworkError('HTTPException: {0!r}'.format(error))
except socket.error as error:
raise NetworkError('socket.error: {0!r}'.format(error))
return decorator