Commit a625d947 authored by Carine Dengler's avatar Carine Dengler
Browse files

fix: catch autentication exception

parent 18b90cdbb8f7
......@@ -174,7 +174,7 @@ from os.path import (exists, join, expanduser, abspath,
basename, dirname, splitext, realpath)
import pkgutil
import pkg_resources
from smtplib import SMTP
from smtplib import SMTP, SMTPAuthenticationError
import stat
import sys
from threading import Lock
......@@ -1255,8 +1255,14 @@ the repository',
try:
try:
smtp = SMTP(server, port)
if smtp_user and smtp_password:
smtp.login(smtp_user, smtp_password)
try:
if smtp_user and smtp_password:
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