diff options
author | Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com> | 2018-01-24 12:33:07 +0100 |
---|---|---|
committer | Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com> | 2018-01-24 12:33:07 +0100 |
commit | 8da32a9eca903c046c3c4713d80a69d342f9484a (patch) | |
tree | b982f371b3063b4896f81dc2a79d7c44bc8dc258 | |
parent | 89e588c3954f46bd6d278443c5e07af66a120052 (diff) | |
download | pykolab-8da32a9eca903c046c3c4713d80a69d342f9484a.tar.gz |
Catch additional exceptions we know the cause of
-rw-r--r-- | pykolab/auth/ldap/__init__.py | 18 |
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())) |