J.Pietschmann wrote:

Phil Steitz wrote:

I am with Henri here. I would not expect error messages from [math] (or [collections] or [lang], etc.) to be passed up directly to a gui or end user console. Designing and managing error messages for the end user to see should happen at the application level, supported by something like [resources], IMHO. I would be hesitant to take on the maintenance of localized [math] error message strings or to load too much content into these strings. Same would apply to other commons components.


This would, however, mean that instead of a generic MathException
there should be a ConvergenceFailureException, SingularMatrixException
etc. in order to give the application a chance to react properlz
without having to parse the error message. Not necessarily a bad thing.

In my experience, if a basic library like [math] throws an exception,
applications rarely deal with it other than
- telling the user an "unexpected math exception" has been caught
- throwing it right to the top level, perhaps crashing the whole app

In FOP, the code responsible for reading images has something like
 catch(Exception e) {
   log("Can't read image");
 }
This deprives the user basically from all facts which could help
in tracking down the problem (for example the specific XML parsing
error including line number in case of an SVG image). OTOH, unwinding
all possible exceptions is hard, and if we got to the root SAX
exception, we'd still have to rely on the actuall message in this
exception.

Yeah, confused? So am I :-)

J.Pietschmann


I'm not opposed to this if it will provide more salient exception handling, as long as ConvergenceFailureException or SingularMatrixException extend MathException via a clear inheritance hierarchy, then the user can decide how detailed they want thier exception handling.


I don't think logging should be used for anything more than debugging purposes.

-Mark Diggory


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to