ldap_set_lderrno() function sets an error code and information about an error in an LDAP structure. You can call this function to set error information that will be retrieved by subsequent ldap_get_lderrno() function calls.
For more information, see "Setting Error Codes" on page 79.
#include <ldap.h>
int ldap_set_lderrno( LDAP *ld, int e, char *m, char *s );
ld |
Connection handle, which is a pointer to an |
e | |
m | In the event that an entry for a specified DN cannot be found , you should set this parameter to the portion of the DN that identifies an existing entry. (See "Receiving the Portion of the DN Matching an Entry" on page 73 for details.) |
s | The text of the error message that you want associated with this error code. |
LDAP_SUCCESS if successful. LDAP_PARAM_ERROR error code is placed in the LDAP structure.
#include <ldap.h>
int rc;
char *errmsg = "Invalid parameter";
...
if ( ldap_my_function() != LDAP_SUCCESS ) {rc = ldap_set_lderrno( ld, LDAP_PARAM_ERROR, NULL, errmsg );
if ( rc != LDAP_SUCCESS ) {printf( "Error: %d\nError code could not be set.\n", rc );
}
return( rc );
}
...
ldap_err2string(), ldap_perror(), ldap_result2error().
Last Updated: 10/01/98 17:06:23