mirror of
https://github.com/kakwa/ldapcherry
synced 2024-11-25 18:54:29 +01:00
Better exception re-raising
re-raising the exception without specifying the exception object gives exactly the previous exception (including the correct stacktrace) which is nicer to have for debugging.
This commit is contained in:
parent
e3fe0b4bfb
commit
27fca43ac6
@ -206,7 +206,7 @@ class LdapCherry(object):
|
|||||||
key,
|
key,
|
||||||
)
|
)
|
||||||
except MissingParameter as e:
|
except MissingParameter as e:
|
||||||
raise e
|
raise
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
self._handle_exception(e)
|
self._handle_exception(e)
|
||||||
raise BackendModuleInitFail(module)
|
raise BackendModuleInitFail(module)
|
||||||
|
@ -130,7 +130,7 @@ class Backend(ldapcherry.backend.Backend):
|
|||||||
severity=logging.ERROR,
|
severity=logging.ERROR,
|
||||||
msg="unknow ldap exception in ldap backend",
|
msg="unknow ldap exception in ldap backend",
|
||||||
)
|
)
|
||||||
raise e
|
raise
|
||||||
|
|
||||||
def _connect(self):
|
def _connect(self):
|
||||||
ldap_client = ldap.initialize(self.uri)
|
ldap_client = ldap.initialize(self.uri)
|
||||||
|
Loading…
Reference in New Issue
Block a user