cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sylvain Wallez <sylvain.wal...@anyware-tech.com>
Subject Sitemap error-handling [was : [VOTE] directly setting variables in sitemap]
Date Tue, 04 Dec 2001 09:13:34 GMT

nicolaken@supereva.it a écrit :
> 
<snip/>
> >
> > Time to introduce an idea I had recently. For now, we only have two
> > types of map:handle-errors : 404 (ResourceNotFoundException) and 500
> > (all other Exceptions). What about extending this to allow specific
> > exception types to trigger specific map:handle-errors ? This would allow
> > the following constructs :
> >
> > <map:handle-errors
> > exception="org.apache.avalon.framework.configuration.ConfigurationError">
> >   <map:act type="warn-admin-of-bad-config"/>
> >   <map:transform src="configError2html.xsl"/>
> >   <map:serialize type="html"/>
> > </map:handle-errors>
> >
> > <map:handle-errors
> > exception="java.lang.security.AccessControlException">
> >   <map:transform src="ace2html.xsl"/>
> >   <map:serialize status-code="403"/>
> > </map:handle-errors>
> >
> > Thoughts ?
> >
> 
> Well, in the xml of the error you have quite a lot on info you can use to decide what
to do without changing the sitemap.
> You could use a special selector that selects on the content of an "error namespace"
tag to select the appropriate action, or a series of transformers like the log transformer
(passthrough) that basically does the same thing.
> I don't see the need of new semantics.
> 
> Nicola Ken Barozzi      These are the days of miracle and wonder...
>                            ...so don't cry baby, don't cry
> <xml-cocoon@nicolaken.com>                             Paul Simon

I'm afraid this won't work : the XML describing the error is only
available at pipeline processing time, that is _after_ all selectors,
actions and the like have been executed.

Also, continuing my proposal, it would be good to be able to specify the
error notifier (the special generator for exceptions). For now it is
hard-coded to use the Notifier which does a nice job for most
exceptions. But we use here some smart exceptions which carry a lot of
useful information and are XMLizable, and I'd like to be able to set the
generator in handle-errors to process this information.

Sylvain

-- 
Sylvain Wallez
Anyware Technologies - http://www.anyware-tech.com

---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


Mime
View raw message