[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: IllegalArgumentException (WG last call on the Java API)



Kurt,
 
Perhaps you could away with PARAM_ERROR
in favor of IllegalArgumentException - except that
IllegalArgumentException is a RuntimeException and
will terminate the application if not caught, where
an Application must catch LDAPException.  Runtime
exceptions are not usually advertised in the Java doc
and are generally considered fatal errors.
 
I don't agree with doing away with all the other API specific
result codes.  If you are serious about this then please
indiciate what standard Java exceptions can used to replace
them.  For instance, REFERRAL_LIMIT_EXCEEDED
is specific to LDAP and has no corresponding Java
Exception.  Replace with ???
 
-Steve

>>> "Kurt D. Zeilenga" <Kurt@OpenLDAP.org> 26-Mar-01 12:38:45 PM >>>
At 10:14 AM 3/26/01 -0700, Steve Sonntag wrote:
>One thing that is confusing to me is the following:
>
>When does a method throw LDAPException with PARAM_ERROR
> vs
>throwing IllegalArgumentException
>
>I realize that the method in the discussion below
>does not throw LDAPException but many others do.
>How does one determine which of the two exceptions is thrown?

I'd suggest doing away with PARAM_ERROR and always
using IllegalArgumentException...  In fact, I suggest
doing away with all LDAPExceptions with API specific
result codes in favor of other Exceptions.

Kurt