commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gilles Sadowski <gil...@harfang.homelinux.org>
Subject Re: [all][math] Help wanted with exceptions API design
Date Tue, 01 Feb 2011 23:16:11 GMT
> > > > The currently defined exceptions in [math] can be found in the
> > > > top-level package and .exceptions.  Those in the top-level have at
> > > > this point been deprecated.
> 
> Don't package your exceptions in a package called ".exceptions". That is very odd.

Why?

> The exception should be defined where they are used.

What do you do for exceptions that are used in several classes and several
packages?

> As I and others have suggested: reuse existing stock exceptions. Only create exceptions
classes if you must.

Depending on the requirements, the exceptions we created may be more
convenient.

> If you consider creating an exception, especially in a hierarchy, think: why would I
want to CATCH this exception as opposed to a superclass?

I don't agree because I don't consider from that stand-point. IMHO, the
exception is useful if it conveys a problem as specifically as possible.
The caller is free to catch, or not, whatever he likes.


Best,
Gilles

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


Mime
View raw message