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

Distinguishing between local and server errors



Rob,

We have an application that needs to handle errors generated by the
server
in a different way from errors generated by the API, i.e. client.  The
error code
ranges don't seem sufficient for the long term to make this
distinction, especially
as we go forward with LDAP and because since no formal definition of
the ranges
have been specified.  Server or client implementations may encroach on
the informal API  range.  It is also possible that some server error
codes might be
generated by the client as well, for example INVALID_DN_SYNTAX.
Adding a special subclass of LDAPException to identify local errors
allows the
application always correctly distinguish between server and client
errors.

I would like to propose that an additional class be added to the API
as follows:

2.x public class LDAPLocalException extends LDAPException

Thrown to indicate that an error been detected locally by the API.
All instances of LDAPException thrown that are not an instance of
LDAPLocalException originate from the LDAP server.

2.x.1 Constructors

   public LDAPLocalException() 
    
   Constructs a default exception with no specific error information. 
    
    
   public LDAPLocalException(String message, 
                        int resultCode) 
    
   Constructs an exception with a result code, and a specified string
as 
   additional information. 
    
   public LDAPLocalException(String message, 
                        int resultCode, 
                        Throwable rootException) 
    
   Constructs an exception with a result code, a specified string, 
   and an embedded root exception as additional information. 
    
      Parameters are: 
  
 
      message        The additional error information 
       
      resultCode     The result code returned 
    
      rootException  An exception which caused the failure, if any

(Methods are inherited from LDAPException)
..........................................................
If this were implemented, it would seem that rootException would be
needed only by this class and not by LDAPException and
LDAPReferralException.

Any Comments?

-Steve
 
 


------------------------
Steven Sonntag
Novell, Inc., The leading provider of Net business solutions
http://www.novell.com