emails: adjust generic smtp error exception text (#57999)

This commit is contained in:
Frédéric Péters 2021-10-20 08:32:18 +02:00
parent 05ae54cf79
commit bbe1b2a57f
1 changed files with 2 additions and 2 deletions

View File

@ -372,8 +372,8 @@ class EmailToSend:
except (smtplib.SMTPRecipientsRefused, smtplib.SMTPNotSupportedError, smtplib.SMTPDataError):
pass
except smtplib.SMTPException as e:
publisher.record_error(_('Failed to authenticate to SMTP server, unknown error.'), exception=e)
raise errors.EmailError('Failed to authenticate to SMTP server, unknown error.')
publisher.record_error(_('Failed to send email, SMTP error.'), exception=e)
raise errors.EmailError('Failed to send email, SMTP error (%s).' % e)
except OSError as e:
publisher.record_error(_('Failed to connect to SMTP server'), exception=e)
raise errors.EmailError('Failed to connect to SMTP server')