You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Derek Hohls <DH...@csir.co.za> on 2007/07/06 12:32:07 UTC
Basic error handling
I am trying to do some very basic error handling in Cocoon 2.1.8
I have defined the following in the sitemap:
<map:selectors default="browser">
<map:selector name="exception"
src="org.apache.cocoon.selection.ExceptionSelector">
<!-- also tried XPathExceptionSelector -->
<exception name="not-found"
class="org.apache.cocoon.ResourceNotFoundException"/>
</map:selector>
</map:selectors>
then, right at the end of the sitemap, after *all* of the
<map:pipeline> sections I have:
<map:handle-errors>
<map:select type="exception">
<map:when test="not-found">
<map:generate type="file" src="docs/missing.xml"/>
<map:call resource="simple-page2html"/>
</map:when>
</map:select>
</map:handle-errors>
</map:pipelines>
</map:sitemap>
However, even this simple check does not work, and I get the usual
"Resource not found" display on my page.
I'd appreciate some help here (yes, I have read the "Error Handling"
section on Cocoon website, but it seems to plunge right into the deep
end and loses me almost straight away - the above snippet is adapted
from the samples).
Thanks
Derek
--
This message is subject to the CSIR's copyright, terms and conditions and
e-mail legal notice. Views expressed herein do not necessarily represent the
views of the CSIR.
CSIR E-mail Legal Notice
http://mail.csir.co.za/CSIR_eMail_Legal_Notice.html
CSIR Copyright, Terms and Conditions
http://mail.csir.co.za/CSIR_Copyright.html
For electronic copies of the CSIR Copyright, Terms and Conditions and the CSIR
Legal Notice send a blank message with REQUEST LEGAL in the subject line to
CallCentre@csir.co.za.
This message has been scanned for viruses and dangerous content by MailScanner,
and is believed to be clean.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: Basic error handling
Posted by Derek Hohls <DH...@csir.co.za>.
It can; but it does not have to - I refer you to the sample
code on oage:
http://cocoon.apache.org/2.1/userdocs/concepts/errorhandling.html
under the section headed:
Error Handler Hierarchy.
>>> Tobia <to...@linux.it> 2007/07/06 02:53 PM >>>
Derek Hohls wrote:
> right at the end of the sitemap, after *all* of the <map:pipeline>
> sections I have:
>
> <map:handle-errors>
> <map:select type="exception">
> <map:when test="not-found">
> <map:generate type="file" src="docs/missing.xml"/>
> <map:call resource="simple-page2html"/>
> </map:when>
> </map:select>
> </map:handle-errors>
>
> </map:pipelines>
>
> </map:sitemap>
I believe handle-errors goes inside a pipeline.
Tobia
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
--
This message is subject to the CSIR's copyright, terms and conditions and
e-mail legal notice. Views expressed herein do not necessarily represent the
views of the CSIR.
CSIR E-mail Legal Notice
http://mail.csir.co.za/CSIR_eMail_Legal_Notice.html
CSIR Copyright, Terms and Conditions
http://mail.csir.co.za/CSIR_Copyright.html
For electronic copies of the CSIR Copyright, Terms and Conditions and the CSIR
Legal Notice send a blank message with REQUEST LEGAL in the subject line to
CallCentre@csir.co.za.
This message has been scanned for viruses and dangerous content by MailScanner,
and is believed to be clean.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: Basic error handling
Posted by Tobia <to...@linux.it>.
Derek Hohls wrote:
> right at the end of the sitemap, after *all* of the <map:pipeline>
> sections I have:
>
> <map:handle-errors>
> <map:select type="exception">
> <map:when test="not-found">
> <map:generate type="file" src="docs/missing.xml"/>
> <map:call resource="simple-page2html"/>
> </map:when>
> </map:select>
> </map:handle-errors>
>
> </map:pipelines>
>
> </map:sitemap>
I believe handle-errors goes inside a pipeline.
Tobia
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org