Provide a better diagnosis on socket errors
This commit is contained in:
parent
29646917c0
commit
6b2e160d27
|
@ -364,8 +364,10 @@ class SMTP:
|
|||
while 1:
|
||||
try:
|
||||
line = self.file.readline()
|
||||
except socket.error:
|
||||
line = ''
|
||||
except socket.error as e:
|
||||
self.close()
|
||||
raise SMTPServerDisconnected("Connection unexpectedly closed: "
|
||||
+ str(e))
|
||||
if not line:
|
||||
self.close()
|
||||
raise SMTPServerDisconnected("Connection unexpectedly closed")
|
||||
|
|
Loading…
Reference in New Issue