cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <>
Subject [2.1] Handling errors in sub sitemap
Date Thu, 03 Apr 2008 13:56:09 GMT
I've tried following the explanation on handling errors with cocoon [1], but I can't get it
working like I expect.

I've a main sitemap in which sits a pipeline:

            <map:match pattern="external/**">
                <map:mount src="site://external/sitemap.xmap" uri-prefix="external" />

And I have a external/sitemap.xmap which contains:

            <map:match pattern="data">
                <map:generate src="repository:default://data/messages.xml" />
                <map:transform src="site://transformers/external/data.xsl" />
                <map:serialize type="xml" />

This site map can throw a inside a ProcessingException. So
I've created a selector:
            <map:selector name="exception" src="org.apache.cocoon.selection.ExceptionSelector">
                <exception name="processing" class="org.apache.cocoon.ProcessingException"
unroll="true" />
                <exceptions name="malformedurl" class=""

I tried putting the selector inside the subsitemap and created a handle-errors:
                <map:select type="exception">
                    <map:when test="processing">
                        <map:generate src="resource://processing.xml" />
                        <map:serialize type="xml" />
                    <map:when test="malformedurl">
                        <map:generate src="resource://malformedurl.xml" />
                        <map:serialize type="xml" />

This piece I tried putting inside the <pipeline> that contains the data matcher and
inside the <pipelines> element that contains the data matcher. This two options didn't
work. Then I tried putting the selector and the handle errors in the <pipelines> element
which contains my mount part. And there it only handled the ProcessingException part and not
the malformed url part.

I'm using Cocoon 2.1.11.

Can errors be handled in the sitemap where they are generated, even though the sitemap is
Why is my processingexception not being unrolled?

Hope someone can help,

Nick S.


View raw message