fixed handling of smtplib.SMTPException, thanks Paolo
This commit is contained in:
+6
-7
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user