1
0
mirror of https://github.com/kakwa/ldapcherry synced 2024-06-09 12:27:50 +02:00

add exception handling

This commit is contained in:
kakwa 2015-05-27 21:59:54 +02:00
parent 380085fdfc
commit e559f69589

View File

@ -167,6 +167,16 @@ class Backend(ldapcherry.backend.Backend):
)
ldap_client.unbind_s()
raise e
except ldap.NO_SUCH_OBJECT as e:
self._logger(
severity = logging.ERROR,
msg = "Search DN '" + basedn \
+ "' doesn't exist, check '" \
+ self.backend_name + ".userdn' or '" \
+ self.backend_name + ".groupdn'",
)
ldap_client.unbind_s()
raise e
ldap_client.unbind_s()
return r