You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by tr...@gmx.de on 2005/04/06 22:39:54 UTC

Error handlers in pipelines

Hi,

I have some problems with error handlers.

I have a selector declared like this (seen anywhere in the user doc):

<map:selector name="exception"
src="org.apache.cocoon.selection.ExceptionSelector">
<exception name="io" class="IOException"/>
<exception name="sax" class="SAXException"/>
<exception name="application" class="ApplicationException"/>
</map:selector>

Then I have a pipeline declared, which basically connects a content provider
via http. I would like to catch any exceptions which occur, when an
IO.Exception happens, which means in our case: the content provider is not
available.

How do i have to implement the error handler if i want to catch the
exception? With my current exception nothing is caught at all. When I try to
catch the upper Processing Exception nothing happens, too!!!

Thanks for any hints!

<map:pipeline>
<map:match pattern="foo/*/*/show.html">
<map:generate src="http://contentprovider.com/whatever">
</map:generate>
<map:transform src="xsl/b2html.xsl">
<map:parameter name="use-request-parameters" value="true"/>
</map:transform>
<map:transform src="xsl/xhtml2html.xsl"/>
<map:serialize type="html"/>
</map:match>

<map:handle-errors>
				
				
<map:select type="exception">
<map:when test="io">
<map:generate src="error/isnotavailable.xml"/>
<map:transform src="xsl/xhtml2html.xsl"/>
<map:serialize type="html"/>
</map:when>
<map:when test="sax">
<map:generate src="error/isnotavailable.xml"/>
<map:transform src="xsl/xhtml2html.xsl"/>
<map:serialize type="html"/>
</map:when>

<map:when test="application">
<map:generate src="error/isnotavailable.xml"/>
<map:transform src="xsl/xhtml2html.xsl"/>
<map:serialize type="html"/>
</map:when>

</map:select>
			
</map:handle-errors>
</map:pipeline>


-- 
Handyrechnung zu hoch? Tipp: SMS und MMS mit GMX
Seien Sie so frei: Alle Infos unter http://www.gmx.net/de/go/freesms

-- 
Handyrechnung zu hoch? Tipp: SMS und MMS mit GMX
Seien Sie so frei: Alle Infos unter http://www.gmx.net/de/go/freesms

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