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 @@ -767,7 +767,16 @@ async def _connect(self):
767
767
def _error_message (self , exception ):
768
768
# args for socket.error can either be (errno, "message")
769
769
# or just "message"
770
- if len (exception .args ) == 1 :
770
+ if not exception .args :
771
+ # asyncio has a bug where on Connection reset by peer, the
772
+ # exception is not instanciated, so args is empty. This is the
773
+ # workaround.
774
+ # See: https://github.com/redis/redis-py/issues/2237
775
+ # See: https://github.com/python/cpython/issues/94061
776
+ return (
777
+ f"Error connecting to { self .host } :{ self .port } . Connection reset by peer"
778
+ )
779
+ elif len (exception .args ) == 1 :
771
780
return f"Error connecting to { self .host } :{ self .port } . { exception .args [0 ]} ."
772
781
else :
773
782
return (
You can’t perform that action at this time.
0 commit comments