commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Stephen Colebourne" <scolebou...@btopenworld.com>
Subject Re: [lang] is nested exception setting planned in ExceptionUtil
Date Fri, 16 Aug 2002 22:10:27 GMT
From: <Joachim.Sauer@tp-soft.com>
> First of all: I was not exactly sure wether this question belongs to user
> or dev, but as it is about both the CVS version of commons-lang and future
> development I think it better fits here, sorry if I'm wrong.

Dev seems right to me.

> I was going to rework Exception handling in ojb
> (http://jakarta.apache.org/ojb/) when someone pointed me to commons-lang
> and its exception package. It seems to be exactly what I'm looking for
> (and has the same architecture than the code that I allready had).
;-)

> But one
> little thing is missing for me: The ability to have a generic
> nested-exception setter method (that is ExceptionUtils.setCause()) that
> tries to set the nested exception by whatever methods/fields are available
> and silently fails (or returns false, or ...) if no such possibility
> exists (so it's a best-effort method).
>
> I'm asking for this, 'cause in OJB we got some cases where we throw normal
> JDK-Exception, but don't want to loose the source exception (for example a
> class implementing Iterator throws a NoSuchElementException that should
> contain a PersistenceBrokerException (an ojb-specific class)). In JDK 1.4
> we could just use initCause, but we can't use this as OJB should be
> 1.2-compatible. (Of course we could extend NoSuchElementException to
> implement Nestable, but it feels wrong to me).
>
> Is this planned? If not, what do you think of it?

At first, I thought that this was an odd use case, but now I can see the
use. However, I'm unclear as to the details of the implementation. From what
you say, we could try an initCause() method, and I guess we could alter
NestedException et al to handle this. But I can't think beyond that. Perhaps
you could put an example static method together?

> and as I'm at it: is another release planned in the near future?

'The' 1.0 release should be relatively soon. But we are still coding
(reflection utils ATM).

Stephen

> regards
> Joachim Sauer
>
> P.S.: I'd apreciate if you could CC me, as I want to avoid to subscribe to
> such a high-traffic ML, but if you don't I'll just look at the archives
> for your answers, thx.
>
> --
> To unsubscribe, e-mail:
<mailto:commons-dev-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail:
<mailto:commons-dev-help@jakarta.apache.org>
>


--
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