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