mirror of
https://github.com/kakwa/ldapcherry
synced 2024-11-25 18:54:29 +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()
|
ldap_client.unbind_s()
|
||||||
raise e
|
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()
|
ldap_client.unbind_s()
|
||||||
return r
|
return r
|
||||||
|
Loading…
Reference in New Issue
Block a user