Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
cubicweb
cubicweb
Commits
959f1b9817a8
Commit
acddcf78
authored
Feb 17, 2021
by
Carine Dengler
Browse files
fix: catch autentication exception
--HG-- branch : 3.25
parent
a91f1eff6e59
Changes
1
Hide whitespace changes
Inline
Side-by-side
cubicweb/cwconfig.py
View file @
959f1b98
...
@@ -189,7 +189,7 @@ from os.path import (exists, join, expanduser, abspath, normpath,
...
@@ -189,7 +189,7 @@ from os.path import (exists, join, expanduser, abspath, normpath,
import
pkgutil
import
pkgutil
import
pkg_resources
import
pkg_resources
import
re
import
re
from
smtplib
import
SMTP
from
smtplib
import
SMTP
,
SMTPAuthenticationError
import
stat
import
stat
import
sys
import
sys
from
threading
import
Lock
from
threading
import
Lock
...
@@ -1408,8 +1408,14 @@ the repository',
...
@@ -1408,8 +1408,14 @@ the repository',
try
:
try
:
try
:
try
:
smtp
=
SMTP
(
server
,
port
)
smtp
=
SMTP
(
server
,
port
)
if
smtp_user
and
smtp_password
:
try
:
smtp
.
login
(
smtp_user
,
smtp_password
)
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
:
except
Exception
as
ex
:
self
.
exception
(
"can't connect to smtp server %s:%s (%s)"
,
self
.
exception
(
"can't connect to smtp server %s:%s (%s)"
,
server
,
port
,
ex
)
server
,
port
,
ex
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment