Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
andymccurdy committed Nov 2, 2015
1 parent 7360a0d commit 9c13fcf
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
2 changes: 2 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
delivered from the socket. This fix also increases performance of
parsing large responses from the Redis server.
* Added support for ZREVRANGEBYLEX.
* ConnectionErrors are now raised if Redis refuses a connection due to
the maxclients limit being exceeded.
* 2.10.3
* Fixed a bug with the bytearray support introduced in 2.10.2. Thanks
Josh Owen.
Expand Down
9 changes: 2 additions & 7 deletions redis/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ def __str__(self):
class BaseParser(object):
EXCEPTION_CLASSES = {
'ERR': {
'default': ResponseError,
'max number of clients reached': ConnectionError
},
'EXECABORT': ExecAbortError,
Expand All @@ -97,12 +96,8 @@ def parse_error(self, response):
response = response[len(error_code) + 1:]
exception_class = self.EXCEPTION_CLASSES[error_code]
if isinstance(exception_class, dict):
return exception_class.get(
response,
exception_class['default']
)(response)
else:
return exception_class(response)
exception_class = exception_class.get(response, ResponseError)
return exception_class(response)
return ResponseError(response)


Expand Down

0 comments on commit 9c13fcf

Please sign in to comment.