commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sebb <>
Subject Re: [math] advertising MathXxExceptions
Date Tue, 04 Oct 2011 21:36:35 GMT
On 4 October 2011 20:57, Phil Steitz <> wrote:
> I have been leaving the standard exception advertisements alone as I
> s/MathRuntimeException.createXxException/new MathXxException, but I
> notice others are changing the @throws to declare the
> MathXxException.  We should probably be consistent.  I don't know if
> it really makes any difference.  I see a pro and a con for each
> approach:
> advertise MathXxx
> pro: users can catch / differentiate math-generated exceptions from
> other standard exceptions of the same type up the stack
> con: users may needlessly scratch heads or check javadoc to make
> sure that, e.g. MathIAE *is* IAE, so they can skip the import and
> catch IAE.

You could put:

@throws MathIAE (extends IAE) <condition causing throw>

or similar.

> advertise Xxx
> pro: follows "favor standard exceptions" practice and avoids need to
> head scratch or import (also the ones that I am talking about are
> really just the standard exceptions with localized
> message-generation capability)
> con: users don't know they can catch the more specific exception
> Phil
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message