cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From giacomo <>
Subject Re: When to log exceptions
Date Wed, 19 Dec 2001 19:55:13 GMT
On Wed, 19 Dec 2001, Peter Royal wrote:

> On Wednesday 19 December 2001 11:04 am, you wrote:
> > c) make the exceptions implement the Notificable and CascadingException
> > interface and make the final catcher (CocoonServlet) log them before
> > sending them to the handle-errors pipline (the patch is almost ready,
> > please stand by ...).
> > The problem with logging exceptions is that in many parts of the code,
> > for at least some time, there were Exceptions logged and not properly
> > rethrown... "see the logs" is not acceptable on normal errors, they
> > must be handled and reported correctly in handle-errors.
> > So I propose to never log exceptions directly (CocoonServlet does) and
> > use logging only for extra reporting.
> Actually they would be caught in the generated sitemap, because that is where
> the handle-errors pipeline is processed. And the sitemap does already log all
> exceptions before passing them onto handle-errors.
> But I would propose a slightly different variant on the choices:
> The sitemap is the final catcher and logger of all exceptions. If an
> exception happens during the processing of a request it must be either
> repackaged inside of another exception (such as some of the SocketException's
> into ConnectionResetException), or re-thrown. It should only be logged in the
> sitemap.

This could work but we need to make it clear to component writers that
they don't have to log exceptions but to re-throw them. Also packaging
them into CascadingExceptions need throwing them.


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

View raw message