[python3-ldap] Feature requests: clearer errors

Michael Ströder michael at stroeder.com
Wed Apr 16 23:34:52 CEST 2014


python3ldap wrote:
> in python3-ldap when you send an operation you get a boolean as return
> value that indicates if the operation is successful or not. You then
> can get the result details in connection.result.

Frankly I did not look at your code yet. But that does not sound like the
approach I would want to deal with.

> Do you mean that everytime that an operation is not successful I should
> raise an exception?

Yes, that's what I need e.g. within web2ldap where the exception handler might
be located several calling layers above. Especially I really like that you can
let exceptions flow without having to deal with them on all layers (like IIRC
Java requires).

But don't forget to attach all available result data to the exception object
which might be needed by the caller (e.g. response controls). That's one of
the deficiencies of current python-ldap.

> I like the idea to let the socket exception flow up to the calling
> application, except than for the Restartable strategy, that
> autoreconnect to the server pool.

Catch the exception, retry with counter and re-raise if all fails.

Ciao, Michael.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2398 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://mail.python.org/pipermail/python3-ldap/attachments/20140416/4069849d/attachment-0001.bin>


More information about the python3-ldap mailing list