Am Dienstag, den 18.12.2007, 15:45 +0100 schrieb Bertrand Delacretaz:
> On Dec 18, 2007 3:42 PM, Felix Meschberger <[EMAIL PROTECTED]> wrote:
> > Am Dienstag, den 18.12.2007, 15:29 +0100 schrieb Tobias Bocanegra:
> > > that why i wouldn't check for a exception script at all. since any
> > > exception would result in a 500 that is where the script is then used.
> > > or what other internal errors do you except ?
> >
> > Just as you might want to handle status codes differently, you might
> > want to handle different exceptions differently ...
> 
> But if the Exception is made available to error handlers (which is a
> good idea anyway), we could say that Exceptions are handled by the 500
> handler, which decides what to do.

Hmm, thinking along those lines, we could make it even simpler: we just
look for an "error" script or servlet, like this:

    Servlet s = resolveScriptOrServlet("error");
    if (s == null) {
        s = defaultErrorHandlerServlet;
    }

Because as defined by the Servlet Spec the Throwable or status code is
made available as request attributes [1].

Regards
Felix


[1] 
http://incubator.apache.org/sling/site/component-api.html#ComponentAPI-ErrorHandling

Reply via email to