[python3-ldap] Feature requests: clearer errors

Christoph Zwerschke cito at online.de
Wed Apr 16 11:43:54 CEST 2014


Am 16.04.2014 10:40, schrieb python3ldap:
> Regarding this problem I think I will create a shallow hierarchy of
> exceptions. My problem is that I'm not sure if is better to let the
> socket errors (and other standard exceptions) flow up or trap them and
> re-raise a custom exception in a custom hierarchy. Do you have any
> suggestion? What other people in this list think about this?

I think re-raising as a subclass of LDAPException is better, because you 
can catch every problem with a single exception handler. This is also 
how Requests and urllib do it. It's also important that all possible 
exceptions are properly documented.

-- Christoph


More information about the python3-ldap mailing list