You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Peter Robins <co...@peterrobins.co.uk> on 2002/03/19 19:28:20 UTC
More problems with handle-errors
Say I want to catch 404 errors with something like this:
<map:handle-errors type="404">
<map:transform src="xslt/error2html.xsl"/>
<map:serialize/>
</map:handle-errors>
If I only have 1 map:pipeline, this works fine: catches the error and
executes the xsl.
However, if I have >1 map:pipeline, it doesn't execute - I just get the
standard miaow from Tomcat. I tried putting it in all map:pipelines, at the
end of the last one, having it in its own map:pipeline (didn't like that),
and nesting it in its own parent map:pipeline (didn't like that either).
In the sample webapp supplied with cocoon, the handle-errors routine doesn't
catch 404 errors either, but I see the syntax is different: instead of
map:handle-errors having a type attribute, map:serialize has a status-code
attribute - presumably this just effects the output stream, and has no
effect on the actual error-handling? If no type attribute is specified,
shouldn't it catch all errors?
---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>
To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>
RE: More problems with handle-errors
Posted by Vadim Gritsenko <va...@verizon.net>.
> From: Peter Robins [mailto:cocoon@peterrobins.co.uk]
>
> Say I want to catch 404 errors with something like this:
>
> <map:handle-errors type="404">
> <map:transform src="xslt/error2html.xsl"/>
> <map:serialize/>
> </map:handle-errors>
>
> If I only have 1 map:pipeline, this works fine: catches the error and
> executes the xsl.
>
> However, if I have >1 map:pipeline, it doesn't execute - I just get
the
> standard miaow from Tomcat. I tried putting it in all map:pipelines,
at the
> end of the last one, having it in its own map:pipeline (didn't like
that),
> and nesting it in its own parent map:pipeline (didn't like that
either).
>
> In the sample webapp supplied with cocoon, the handle-errors routine
doesn't
> catch 404 errors either, but I see the syntax is different: instead of
> map:handle-errors having a type attribute, map:serialize has a
status-code
> attribute - presumably this just effects the output stream, and has no
> effect on the actual error-handling? If no type attribute is
specified,
> shouldn't it catch all errors?
No.
Type attribute have the default of 500 (for backward compatibility), and
handler of type 500 does not processes 404 errors (for backward
compatibility).
Vadim
---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>
To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>