[python3-ldap] Feature requests: clearer errors

Michael Ströder michael at stroeder.com
Wed Apr 16 11:29:32 CEST 2014


On Wed, 16 Apr 2014 10:40:25 +0200 python3ldap <python3ldap at gmail.com> wrote
> 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?

At least you should map any LDAP result code to a separate exception attaching
more data returned by the server with the result like response controls.
Otherwise fine-grained error handling is impossible.

For socket errors I'd recommend to not catch them within your module.
Just let the calling application deal with them.

Ciao, Michael.




More information about the python3-ldap mailing list