File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -805,15 +805,20 @@ def can_read(self, timeout=0):
805
805
806
806
def read_response (self , disable_decoding = False ):
807
807
"""Read the response from a previously sent command"""
808
+ try :
809
+ hosterr = f"{ self .host } :{ self .port } "
810
+ except AttributeError :
811
+ hosterr = "connection"
812
+
808
813
try :
809
814
response = self ._parser .read_response (disable_decoding = disable_decoding )
810
815
except socket .timeout :
811
816
self .disconnect ()
812
- raise TimeoutError (f"Timeout reading from { self . host } : { self . port } " )
817
+ raise TimeoutError (f"Timeout reading from { hosterr } " )
813
818
except OSError as e :
814
819
self .disconnect ()
815
820
raise ConnectionError (
816
- f"Error while reading from { self . host } : { self . port } " f" : { e .args } "
821
+ f"Error while reading from { hosterr } " f" : { e .args } "
817
822
)
818
823
except BaseException :
819
824
self .disconnect ()
You can’t perform that action at this time.
0 commit comments