Commit 008c229b authored by Carine Dengler's avatar Carine Dengler
Browse files

fix: catch autentication exception

--HG--
branch : 3.26
parent ff3ead99e95f
......@@ -186,7 +186,7 @@ from os.path import (exists, join, expanduser, abspath, normpath,
import pkgutil
import pkg_resources
import re
from smtplib import SMTP
from smtplib import SMTP, SMTPAuthenticationError
import stat
import sys
from threading import Lock
......@@ -1350,7 +1350,13 @@ the repository',
try:
smtp = SMTP(server, port)
if smtp_user and smtp_password:
smtp.login(smtp_user, smtp_password)
try:
smtp.login(smtp_user, smtp_password)
except SMTPAuthenticationError as exception:
self.exception(
"cannot log in to SMTP server %s:%s (%s)",
server, port, exception,
)
except Exception as ex:
self.exception("can't connect to smtp server %s:%s (%s)",
server, port, ex)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment