commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cost...@covalent.net
Subject Re: DBCP/LANG
Date Tue, 13 Aug 2002 18:51:13 GMT
On 13 Aug 2002, Daniel Rall wrote:

> > Throwable ExceptionUtils.getCause(Throwable);
> > 
> > seems right the right signature.
> 
> I agree, and have implemented such a class (with unit tests) and
> committed it to the exception package of [lang].  I added two methods,
> one to get the immediate cause, and another to ferret out the root
> cause (after walking the exception tree).  Costin, Henri, when you
> have a moment, any review would be appreciated.

Great !


> Note that I didn't implement RMI's "detail" instance attribute,
> partially because I think it's a poor pattern, and partially because
> I'm not a big fan of RMI (I prefer a SPOF-less MOM approach).

Is this a joke ? 
Maybe you want to do a getClass().getName() and filter out 
other technologies/APIs you don't like :-) 

Well, seriously speaking there are few other patterns I've seen:
  getNextException
  getRootCause
  getException

I don't remember where :-), but at least the 'exception walking' 
util in tomcat is checking for them. 

I think it is worth trying to cover all cases.

Even if they are not very frequent - it doesn't hurt to include
it. 

> > For NestException - can you give me any benefit or functionaity that 
> > can't be provided for generic Throwables, using getCause() ? 
> 
> Another benefit includes stack trace joining (i.e. trace of the casual
> exception is appended to the trace of the primary exception).  This
> functionality might be useful to refactor into the new ExceptionUtils
> class.

+1

Another interesting issue is parsing the line numbers out of the
stack trace.

And probably a more specialised one, for applications using code 
generation - find the line in the 'original' file, using the 
stack trace and a mapping table. That's done in jasper- and 
quite complex, probably it's better to leave it there or wait
for the new 'debugging for foreign languages' impl.

Costin


--
To unsubscribe, e-mail:   <mailto:commons-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:commons-dev-help@jakarta.apache.org>


Mime
View raw message