summaryrefslogtreecommitdiffstats
path: root/pykolab
diff options
context:
space:
mode:
authorJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2018-01-24 12:33:07 +0100
committerJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2018-01-24 12:33:07 +0100
commit8da32a9eca903c046c3c4713d80a69d342f9484a (patch)
treeb982f371b3063b4896f81dc2a79d7c44bc8dc258 /pykolab
parent89e588c3954f46bd6d278443c5e07af66a120052 (diff)
downloadpykolab-8da32a9eca903c046c3c4713d80a69d342f9484a.tar.gz
Catch additional exceptions we know the cause of
Diffstat (limited to 'pykolab')
-rw-r--r--pykolab/auth/ldap/__init__.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/pykolab/auth/ldap/__init__.py b/pykolab/auth/ldap/__init__.py
index f2d2738..cfbed90 100644
--- a/pykolab/auth/ldap/__init__.py
+++ b/pykolab/auth/ldap/__init__.py
@@ -232,6 +232,24 @@ class LDAP(pykolab.base.Base):
return False
+ except ldap.NO_SUCH_OBJECT:
+ log.error(
+ _("Invalid DN, username and/or password for '%s'.") % (
+ bind_dn
+ )
+ )
+
+ return False
+
+ except ldap.INVALID_CREDENTIALS:
+ log.error(
+ _("Invalid DN, username and/or password for '%s'.") % (
+ bind_dn
+ )
+ )
+
+ return False
+
except Exception, errmsg:
log.error(_("Exception occurred: %r") % (errmsg))
log.error(_("%s") % (traceback.format_exc()))