diff --git a/swiftclient/client.py b/swiftclient/client.py index 8466cc5b..e0d35a8e 100644 --- a/swiftclient/client.py +++ b/swiftclient/client.py @@ -1400,7 +1400,7 @@ class Connection(object): self.http_conn = None except ClientException as err: self._add_response_dict(caller_response_dict, kwargs) - if self.attempts > self.retries: + if self.attempts > self.retries or err.http_status is None: logger.exception(err) raise if err.http_status == 401: diff --git a/swiftclient/exceptions.py b/swiftclient/exceptions.py index 9a776727..370a8d0f 100644 --- a/swiftclient/exceptions.py +++ b/swiftclient/exceptions.py @@ -17,9 +17,9 @@ class ClientException(Exception): def __init__(self, msg, http_scheme='', http_host='', http_port='', - http_path='', http_query='', http_status=0, http_reason='', + http_path='', http_query='', http_status=None, http_reason='', http_device='', http_response_content=''): - Exception.__init__(self, msg) + super(ClientException, self).__init__(msg) self.msg = msg self.http_scheme = http_scheme self.http_host = http_host