fixed handling of smtplib.SMTPException, thanks Paolo

This commit is contained in:
mdipierro
2020-06-14 00:30:56 -07:00
parent ae2425d348
commit 79f64cbe72
+6 -7
View File
@@ -819,13 +819,12 @@ class Mail(object):
# do not want to hide errors raising some exception here # do not want to hide errors raising some exception here
try: try:
server.quit() server.quit()
except: except smtplib.SMTPException:
pass # ensure to close any socket with SMTP server
# ensure to close any socket with SMTP server try:
try: server.close()
server.close() except Exception:
except: pass
pass
except Exception as e: except Exception as e:
logger.warning('Mail.send failure:%s' % e) logger.warning('Mail.send failure:%s' % e)
self.result = result self.result = result