commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dave Newton <>
Subject Re: [digester] using digester's exceptions
Date Tue, 11 Mar 2003 23:31:58 GMT
On Tue, 2003-03-11 at 17:52, robert burrell donkin wrote:
> On Tuesday, March 11, 2003, at 10:11 PM, Erik Price wrote:
> > Thanks Robert.  My concern arose from the fact that, when I investigated 
> > the classes that extend java.lang.Exception, there are a ton of 
> > CORBA-specific or JNDI-specific (etc) Exceptions and I wondered if we're 
> > all supposed to make custom exceptions like this all the time.
> this is a concern - but i didn't really want to get into the issue of the 
> 'right' exception handling strategy. there are different schools of 
> thought about the right way to do exception handling. IMHO this issue can 
> get a little religious.

Reverend Dave says: I hate relying on other people's classes if they
might change at any time. Probably won't happen in this case, but for
maximum reusability (java, after all ;) I almost always create my own
exception classes.

As a pathological example, what if you wanted to use the exact same code
using somebody else's Digester thus losing access to the
commons-digester XmlLoadException? 

Or if you were throwing it from deeper within your code from a
generalized method that neither would nor should know anything about a
Digester at all?

Again, in this case I'm sure it doesn't matter, so I'll take off the
funny hat now.


View raw message