ldap_get_lderrno()--Retrieve Error Information


  Syntax
 #include <ldap.h>

 int ldap_get_lderrno(
         LDAP        *ld,
         char        **dn,
         char        **errmsg)

  Library Name/Service Program: QSYS/QGLDCLNT

  Default Public Authority: *USE

  Threadsafe: Yes

The ldap_get_lderrno() function retrieves information about the most recent error that occurred for an LDAP operation. This function can be called for any LDAP API that does not return an error.

When an error occurs at the LDAP server, the server returns both an LDAP result code and a message containing any additional information about the error from the server. If the error occurred because an entry specified by a Distinguished Name (DN) could not be found, the server may also return the portion of the DN that identifies an existing entry. Use ldap_get_lderrno() to obtain both the message containing error information and the matched DN.


Authorities and Locks

No IBM® i authority is required.


Parameters

ld
(Input) Specifies the LDAP pointer returned by a previous call to ldap_init(), ldap_ssl_init(), or ldap_open().
dn
(Output) The distinguished name (DN) that identifies an existing entry, indicating how much of the name in the request was recongnized by the server. The DN is returned when an LDAP_NO_SUCH_OBJECT error is returned from the server on some previous operation. The matched DN string should be freed by calling ldap_memfree().
errmsg
(Output) The text of the error message, as returned from the server. The error message string should be freed by calling ldap_memfree().


Return Value

LDAP error code
See LDAP Client API Error Conditions for possible LDAP error codes values.

Error Messages

The following message may be sent from this function.

Message ID Error Message Text
CPF3CF2 E Error(s) occurred during running of ldap_get_lderrno API.


Related Information



API introduced: V5R1

[ Back to top | LDAP APIs | APIs by category ]