Skip to content

Commit 4691ff8

Browse files
committed
fix: log the exceptions
1 parent e707801 commit 4691ff8

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

lib/vsc/utils/mail.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,15 +117,16 @@ def _send(self, mail_from, mail_to, mail_subject, msg):
117117
try:
118118
s.sendmail(mail_from, mail_to, msg.as_string())
119119
except smtplib.SMTPHeloError as err:
120-
logging.error("Cannot get a proper response from the SMTP host %s", self.mail_host)
120+
logging.error("Cannot get a proper response from the SMTP host %s: %s", self.mail_host, err)
121121
raise
122122
except smtplib.SMTPRecipientsRefused as err:
123-
logging.error("All recipients were refused by SMTP host %s [%s]", self.mail_host, mail_to)
123+
logging.error("All recipients were refused by SMTP host %s [%s]: %s", self.mail_host, mail_to, err)
124124
raise
125125
except smtplib.SMTPSenderRefused as err:
126-
logging.error("Sender was refused by SMTP host %s [%s]", self.mail_host, mail_from)
126+
logging.error("Sender was refused by SMTP host %s [%s]: %s", self.mail_host, mail_from, err)
127127
raise
128128
except smtplib.SMTPDataError as err:
129+
logging.error("Data error: %s", err)
129130
raise
130131

131132
except smtplib.SMTPConnectError as err:

0 commit comments

Comments
 (0)