diff options
author | Andy McCurdy <andy@andymccurdy.com> | 2014-03-10 21:48:35 -0700 |
---|---|---|
committer | Andy McCurdy <andy@andymccurdy.com> | 2014-03-10 21:48:35 -0700 |
commit | da842ef917afadb169fb3f19d36b5d83c5c4a831 (patch) | |
tree | 72059f8e57a08e5506257375050256bb27da0ea6 /redis/connection.py | |
parent | f4f89e9516a2922c4ef2d7448c6ef30d8133fc84 (diff) | |
download | redis-py-da842ef917afadb169fb3f19d36b5d83c5c4a831.tar.gz |
make sure hiredis parser raises connection errors
Diffstat (limited to 'redis/connection.py')
-rw-r--r-- | redis/connection.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/redis/connection.py b/redis/connection.py index 3b1ab89..8a064b3 100644 --- a/redis/connection.py +++ b/redis/connection.py @@ -200,6 +200,11 @@ class HiredisParser(BaseParser): response = self._reader.gets() if isinstance(response, ResponseError): response = self.parse_error(response.args[0]) + # hiredis only knows about ResponseErrors. + # self.parse_error() might turn the exception into a ConnectionError + # which needs raising. + if isinstance(response, ConnectionError): + raise response return response if HIREDIS_AVAILABLE: |