File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -771,7 +771,16 @@ async def _connect(self):
771
771
def _error_message (self , exception ):
772
772
# args for socket.error can either be (errno, "message")
773
773
# or just "message"
774
- if len (exception .args ) == 1 :
774
+ if not exception .args :
775
+ # asyncio has a bug where on Connection reset by peer, the
776
+ # exception is not instanciated, so args is empty. This is the
777
+ # workaround.
778
+ # See: https://github.com/redis/redis-py/issues/2237
779
+ # See: https://github.com/python/cpython/issues/94061
780
+ return (
781
+ f"Error connecting to { self .host } :{ self .port } . Connection reset by peer"
782
+ )
783
+ elif len (exception .args ) == 1 :
775
784
return f"Error connecting to { self .host } :{ self .port } . { exception .args [0 ]} ."
776
785
else :
777
786
return (
You can’t perform that action at this time.
0 commit comments