mengelhart at katahdinsoftware.com
Tue Oct 29 18:42:45 CET 2002
right - I guess was thinking more along the lines of directly in the
documentation on the ldap operations page, having a paragraph that says
"For the following methods, x(), y(), z(), ldap.LDAPError exceptions
are raised instead of returning error codes - click <a
">here</a> for more information on the Exceptions that can occur."
In my case, I read through the exception page and didn't "get" that
delete_s doesn't return error codes because there is documentation
like this mixed into the LDAP operations page for say the result()
The result() method returns a tuple of the form (result-type,
result-data). The first element, result-type is a string, being one of:
'RES_BIND', 'RES_SEARCH_ENTRY', 'RES_SEARCH_RESULT', 'RES_MODIFY',
'RES_ADD', 'RES_DELETE', 'RES_MODRDN', or 'RES_COMPARE'. (The module
constants RES_* are set to these strings, for your convenience.)
This method does return codes and it seems to me that based on that if
it's not explicitly stated that other methods would as well.
Personally I would like to see the documentation have examples for each
function written in python but I doubt anyone has time for that. I'll
start collecting mine and maybe put them up somewhere.
On Tuesday, October 29, 2002, at 12:28 PM, Michael Ströder wrote:
> Michael Engelhart wrote:
>>> Thanks to the early design decision of David you don't have to do
>>> error handling by checking result codes. If an error occurs during
>>> deletion of an entry an exception of class ldap.LDAPError or a
>>> derived error class is raised.
>> maybe that little tidbit should be in the documentation somewhere?
> Ciao, Michael.
More information about the python-ldap