Skip to content

Commit 71176fc

Browse files
author
andy
committed
fix for #358 and #351
1 parent 44e9c7b commit 71176fc

File tree

2 files changed

+17
-4
lines changed

2 files changed

+17
-4
lines changed

CHANGES

+7-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
1-
* 2.8.0 (in development)
1+
* 2.7.6
22
* Added CONFIG RESETSTAT command. Thanks Yossi Gottlieb.
33
* Fixed a bug introduced in 2.7.3 that caused issues with script objects
44
and pipelines. Thanks Carpentier Pierre-Francois.
55
* Converted redis-py's test suite to use the awesome py.test library.
6+
* Fixed a bug introduced in 2.7.5 that prevented a ConnectionError from
7+
being raised when the Redis server is LOADING data.
8+
* Added a BusyLoadingError exception that's raised when the Redis server
9+
is starting up and not accepting commands yet. BusyLoadingError
10+
subclasses ConnectionError, which this state previously returned.
11+
Thanks Yossi Gottlieb.
612
* 2.7.5
713
* DEL, HDEL and ZREM commands now return the numbers of keys deleted
814
instead of just True/False.

redis/connection.py

+10-3
Original file line numberDiff line numberDiff line change
@@ -113,9 +113,16 @@ def read_response(self):
113113
# server returned an error
114114
if byte == '-':
115115
response = nativestr(response)
116-
# *return*, not raise the exception class. if it is meant to be
117-
# raised, it will be at a higher level.
118-
return self.parse_error(response)
116+
error = self.parse_error(response)
117+
# if the error is a ConnectionError, raise immediately so the user
118+
# is notified
119+
if isinstance(error, ConnectionError):
120+
raise error
121+
# otherwise, we're dealing with a ResponseError that might belong
122+
# inside a pipeline response. the connection's read_response()
123+
# and/or the pipeline's execute() will raise this error if
124+
# necessary, so just return the exception instance here.
125+
return error
119126
# single value
120127
elif byte == '+':
121128
pass

0 commit comments

Comments
 (0)