commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From S├ębastien Brisard <>
Subject Re: [math] Consistent use of ExceptionContext [was "using the ExceptionContext facility"]
Date Fri, 26 Aug 2011 11:02:36 GMT
Hi Gilles,
thanks for this answer.
> I am assuming that the main difference between using the "ExceptionContext"
> and passing information in the exception's constructor is that in the
> latter, the information will unconditionally appear in the string returned
> by "getMessage". The contents of the "ExceptionContext" must be retrieved
> manually because, as is the case for iterative solvers, it could lead to a
> huge message.
Yes. Or even in some cases to "impossible" messages since it is
totally unthinkable to compute the entries of the matrix underlying
the general linear operator. In fact, for debugging purposes, printing
the operator is not in my view necessary. For example, if the
preconditioned conjugate gradient throws a
NonPositiveDefiniteLinearOperatorException, I just need to know which
one of the operator or its preconditioner was found not to be positive

> Thus, when debugging an application, one can catch the exception and loop
> over the context keys using the "getKeys()" method, without needing to need
> the key names in advance. [Thus I would keep the key names "private".]
OK, I understand. But we *do* document the keys, don't we? For
example, would the Javadoc of the Conjugate Gradient method state
which keys are used for what purpose?

Best regards,

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

View raw message