Loading transfer_service/mailer.py +2 −1 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ from email.policy import SMTP from redis_log_handler import RedisLogHandler from smtplib import SMTPConnectError from smtplib import SMTPException from socket import gaierror class Mailer(object): Loading Loading @@ -70,7 +71,7 @@ class Mailer(object): try: smtpObj = smtplib.SMTP(self.smtpServer, self.smtpPort) smtpObj.send_message(self.message) except SMTPConnectError: except (gaierror, SMTPConnectError): self.logger.exception("Cannot connect to SMTP server.") except TimeoutError: self.logger.exception("Connection timeout.") Loading Loading
transfer_service/mailer.py +2 −1 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ from email.policy import SMTP from redis_log_handler import RedisLogHandler from smtplib import SMTPConnectError from smtplib import SMTPException from socket import gaierror class Mailer(object): Loading Loading @@ -70,7 +71,7 @@ class Mailer(object): try: smtpObj = smtplib.SMTP(self.smtpServer, self.smtpPort) smtpObj.send_message(self.message) except SMTPConnectError: except (gaierror, SMTPConnectError): self.logger.exception("Cannot connect to SMTP server.") except TimeoutError: self.logger.exception("Connection timeout.") Loading