directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Emmanuel Lecharny <>
Subject Exception handling
Date Mon, 10 Jan 2011 14:29:58 GMT

it's not the first time I'm annoyed by the way the exception are 
'swallowed' by the server, but now, I think there is something to do to 
fix that.

What happens is that we have two kind of exceptions being generated by 
the server :
- LDAP related exceptions, those we throw in the server by creating a 
new LDAPException.
- other exceptions, like NullPointerException, which are encapsulated in 
some way or another

At the end, from the client side, what we get is an UnexpectedException 
in the second case, with no way to know where the exception is coming from.

Since I started to work on the server almost 6 years ago, I was 
convinced that writing StackTraces in the logs was a error, as it could 
fill the logs very quickly, and make them grow so fast that any valuable 
message could be buried into millions of lines of stack trace.

Right now, I think that I would rather have those stackTraces instead of 
spending hours debugging the server or adding some temporary 
e.printStackTraces in some random places. Typically, today, I tracked 
down a NPE which was generated by a error message using a null reference 
to inform the client about the cause of the error. Isn't it ironical 
that trying to give back some info when some error occurred you get a 
NPE ? No. In fact, it happens all the time, but we aren't protected 
against such mistakes.

Now, I would suggest we add some handling of such exception at the 
higher level, ie in core-session.

Wdyt ?

Emmanuel L├ęcharny

View raw message