cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bruno Dumon <br...@outerthought.org>
Subject Re: Should we catch java.lang.Error? (was RE: XMLForm and sitemap problem (fwd))
Date Thu, 08 May 2003 13:05:06 GMT
On Thu, 2003-05-08 at 14:40, Berin Loritsch wrote:
> Bruno Dumon wrote:
> > On Thu, 2003-05-08 at 12:20, Stephan Michels wrote:
> > 
> >>I can reproduce the blank page in case of a java.lang.Error. So,
> >>there is the best place to handle them? In the pipeline implementation?
> >>Or should they be handled by the container?
> > 
> > 
> > I would treat them like exceptions, so that something meaningful can be
> > done with them in the handle-errors.
> > 
> > Or at least we should catch them in the CocoonServlet class, and send a
> > 500 to the browser.
> 
> If you ever decide to catch an Error, you should ALWAYS rethrow it.
> All you are doing is being provided an opportunity to clean up--but
> the only recourse with one of those (strictly speaking) is to shut
> down.
> 

Seems logical when reading the description for Error, but take for
example Sylvain T's case: he got a NoClassDefFoundError. Is this error
so critical that the entire application should be shut down? I think it
is enough to shut down just the part that was having problems, in his
case an Action.

Other Errors could be more critical though.

So maybe it's better to go with the second approach then: simply send a
500 to the browser, log the error, and rethrow it.

-- 
Bruno Dumon                             http://outerthought.org/
Outerthought - Open Source, Java & XML Competence Support Center
bruno@outerthought.org                          bruno@apache.org


Mime
View raw message