summaryrefslogtreecommitdiff
path: root/redis/client.py
diff options
context:
space:
mode:
authorAndy McCurdy <andy@andymccurdy.com>2010-11-18 08:26:06 -0800
committerAndy McCurdy <andy@andymccurdy.com>2010-11-18 08:26:06 -0800
commit52f17891a5523505ea1c4881bffc650ad97035bf (patch)
tree45f05c67d8af28c3be437f8d4369533f9ba24e42 /redis/client.py
parentb3e28546e4ff484a816a50b4ffb4011edd192e80 (diff)
downloadredis-py-52f17891a5523505ea1c4881bffc650ad97035bf.tar.gz
better error handing during socket writing. fixes #83
Diffstat (limited to 'redis/client.py')
-rw-r--r--redis/client.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/redis/client.py b/redis/client.py
index c4f3bc4..3f9af0d 100644
--- a/redis/client.py
+++ b/redis/client.py
@@ -85,8 +85,12 @@ class Connection(object):
except socket.error, e:
if e.args[0] == errno.EPIPE:
self.disconnect()
+ if isinstance(e.args, basestring):
+ errno, errmsg = 'UNKNOWN', e.args
+ else:
+ errno, errmsg = e.args
raise ConnectionError("Error %s while writing to socket. %s." % \
- e.args)
+ (errno, errmsg))
def read(self, length=None):
"""