mirror of
https://github.com/kakwa/ldapcherry
synced 2024-12-22 12:50:18 +01:00
add exception handling
This commit is contained in:
parent
380085fdfc
commit
e559f69589
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user