[python3-ldap] Feature requests: clearer errors

python3ldap python3ldap at gmail.com
Wed Apr 16 10:40:25 CEST 2014


Hello Richard,
Thanks for your message,
I know that the Exceptions management of python3-ldap is barely
sufficient to know that an error has happened. I'm still working on
some features I want to be in the 1.0 release of the library.
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?

Bye,
Giovanni



2014-04-16 0:33 GMT+02:00 Richard Esplin <richard-lists at esplins.org>:
> Thank you for the great library. It is much more pythonic and easier to use
> than the old python-ldap.
>
> My only challenge in using the library is that there appears to only be one
> exception: LDAPException, and many error messages are very cryptic. It would
> help to have distinct exceptions for common errors. A good starting point
> would be to look at the exceptions listed in the documentation for the python-
> ldap module.
>
> Specific things clients need to identify:
> * auto_bind failure due to a bad basedn in the username parameter (python-ldap
> would return NO_SUCH_OBJECT), or due to a bad password (python-ldap would
> return INVALID_CREDENTIALS). Current message in the exception for both
> scenarios is: Exception: auto_bind not successful. This error made me first
> look at network connectivity.
> * using an ldaps URL and connecting on the standard port without using the SSL
> flag given an error about the socket closing unexpectedly.
> * using a CA cert in the local_certificate_file instead of the ca_certs_file
> gives an error about "[SSL] PEM lib (_ssl.c:2138)" that is completely
> unhelpful.
>
> Hopefully this is a useful suggestion to you, and my documenting what I found
> helps others.
>
> I plan on continuing to use this library. Thank you very much.
>
> Richard
>
> P.S. Please excuse the cross post. I originally posted this as an issue at
> Assemblia, but I couldn't figure out how to make it a public issue. Perhaps the
> re-post here might help other people diagnose these errors. I also hope the
> list activity helps anyone researching the library to see that it is reliable.
> _______________________________________________
> python3-ldap mailing list
> python3-ldap at python.org
> https://mail.python.org/mailman/listinfo/python3-ldap


More information about the python3-ldap mailing list