directory-api mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Shawn McKinney <smckin...@apache.org>
Subject Re: LdapNetworkConnection. add eating exceptions
Date Tue, 06 Apr 2021 13:02:23 GMT


> On Apr 5, 2021, at 2:32 PM, Stefan Seelmann <mail@stefan-seelmann.de> wrote:
> 
> I can only speak for API V2 but I think for V1 it's similar.
> 
> I also was surprised by that behavior, but it's "as designed" and makes
> sense and is consistent :)
> 
> The LdapConnection methods that take a raw XyzRequest object also return
> a raw XyzResponse object. Those only throw an exception if a network
> level exceptions happens. But if the LDAP server properly returns a
> response (be is positive or negative) the raw response is returned to
> the caller and the caller has to inspect it.
> 
> There are other methods like add(Entry) or delete(Dn) or modify(Dn,
> Modification) which return void. For those methods it's different and
> the response from the server is processed by
> ResultCodeEnum.processResponse() which throws LDAP specific exceptions
> for non-successfule responses.
> 

You hit the nail on the head Stefan.  That’s what happened here.  Before, was using the
void returning methods and this was not observed.

Changed to using the raw methods, on order to send the ‘relax control’ (which I don’t
know how to attach to the add/modify).

> If you use the raw request/response methods you can use that utility
> method too if you like.
> 

Very good info.  That’s what I’ll do.

> I agree that it looks surprising, propbably we should improve the javadoc?

Yeah, would be worth pointing out me think too.  Thanks for chiming in Stefan.

—
Shawn
---------------------------------------------------------------------
To unsubscribe, e-mail: api-unsubscribe@directory.apache.org
For additional commands, e-mail: api-help@directory.apache.org


Mime
View raw message