cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Berin Loritsch <blorit...@apache.org>
Subject Re: Should we catch java.lang.Error? (was RE: XMLForm and sitemap problem (fwd))
Date Thu, 08 May 2003 12:40:21 GMT
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.


> 
> As background info, here is what the javadoc for the Error class says:
> 
> "An Error is a subclass of Throwable that indicates serious problems
> that a reasonable application should not try to catch. Most such errors
> are abnormal conditions. The ThreadDeath error, though a "normal"
> condition, is also a subclass of Error because most applications should
> not try to catch it. 
> 
> A method is not required to declare in its throws clause any subclasses
> of Error that might be thrown during the execution of the method but not
> caught, since these errors are abnormal conditions that should never
> occur."
> 


-- 
"You know the world is going crazy when the best
rapper is a white guy, the best golfer is a black guy,
The Swiss hold the America's Cup, France is
accusing the US of arrogance, and Germany doesn't want
to go to war. And the 3 most powerful men in America
are named 'Bush', 'Dick', and 'Colon' (sic)".

-----Chris Rock


Mime
View raw message