summaryrefslogtreecommitdiff
path: root/swiftclient/client.py
diff options
context:
space:
mode:
authorHemanth Makkapati <hemanth.makkapati@mailtrust.com>2013-07-16 21:22:32 +0000
committerHemanth Makkapati <hemanth.makkapati@mailtrust.com>2013-07-17 15:11:15 +0000
commit2f84a4e76b03863fe2e62515f150580b09dc20d1 (patch)
treef2918ac56caafedb4eed8129713f3855718e796b /swiftclient/client.py
parent07d13b5262f014bbfceacef0c0622bf156025aac (diff)
downloadpython-swiftclient-2f84a4e76b03863fe2e62515f150580b09dc20d1.tar.gz
Added log statements in swift client
Added log statements in swiftclient/client.py:_retry where exceptions are being raised. Fixes bug# 1202229 Change-Id: I727537177849d08bb9603aa884152bdebc62fb85
Diffstat (limited to 'swiftclient/client.py')
-rw-r--r--swiftclient/client.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/swiftclient/client.py b/swiftclient/client.py
index 7791a4c..0bdc4bc 100644
--- a/swiftclient/client.py
+++ b/swiftclient/client.py
@@ -1132,20 +1132,23 @@ class Connection(object):
rv = func(self.url, self.token, *args, **kwargs)
self._add_response_dict(caller_response_dict, kwargs)
return rv
- except (socket.error, HTTPException):
+ except (socket.error, HTTPException) as e:
self._add_response_dict(caller_response_dict, kwargs)
if self.attempts > self.retries:
+ logger.exception(e)
raise
self.http_conn = None
except ClientException as err:
self._add_response_dict(caller_response_dict, kwargs)
if self.attempts > self.retries:
+ logger.exception(err)
raise
if err.http_status == 401:
self.url = self.token = None
if retried_auth or not all((self.authurl,
self.user,
self.key)):
+ logger.exception(err)
raise
retried_auth = True
elif err.http_status == 408:
@@ -1153,6 +1156,7 @@ class Connection(object):
elif 500 <= err.http_status <= 599:
pass
else:
+ logger.exception(err)
raise
sleep(backoff)
backoff = min(backoff * 2, self.max_backoff)