[Date Prev][Date Next]
RE: How to get error response text?
> -----Original Message-----
> From: owner-openldap-software@OpenLDAP.org
> [mailto:owner-openldap-software@OpenLDAP.org]On Behalf Of Dieter
> Sent: Thursday, March 25, 2004 12:00 AM
> To: openldap-software@OpenLDAP.org
> Subject: Re: How to get error response text?
> Thomas Gagné <email@example.com> writes:
> > I've noticed in network traces that an error number is
> returned, like
> > "server unwilling to perform" but the message also includes
> some text,
> > like "use bind to verify old password". Where can I find that text?
ldap.h lists the standard meanings of LDAP result codes. If you want to get
the additional error text that accompanies an LDAP result message, you should
call ldap_parse_result() on the result message. If you used a synchronous
libldap call, then you didn't get the result message returned to you. In this
case, you can use ldap_get_option() with the LDAP_OPT_ERROR_STRING selector.
This approach is not reliable if your app is multithreaded and you have
multiple operations going on on the same LDAP* handle though; in that case
you should avoid using the synchronous calls, and always use
-- Howard Chu
Chief Architect, Symas Corp. Director, Highland Sun
Symas: Premier OpenSource Development and Support