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
definite.

>
> 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,
Sébastien

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

Reply via email to