To conclude what it was said.
If you want to use the exception in a pipeline, you can set it like that :
<map:handle-errors>
<map:select type="exception">
<map:when test="CustomException">
<map:generate type="notify" />
<map:transform type="xslt" src="xsl/error_cocoon.xsl" />
<map:serialize type="html" />
</map:when>
</map:select>
</map:handle-errors>This only works with Cocoon 2.1
As far as I know, with 2.0, you can not select which exception you want to use. But You can get it like that :
In the sitemap :
<map:handle-errors>
<map:transform type="xslt" src="xsl/error2.xsl" />
<map:serialize type="html" />
</map:handle-errors>Java classes :
throw new ProcessingException("Your message");Lionel
At 12:36 06/11/2003 -0600, you wrote:
Jorg Heymans wrote:
i think the problem here is that all exceptions are propagated, but not all are caught by the handle:errors section.
It would be good to get a statement from an expert here on exactly what exception to throw so they are guaranteed to be caught by the handle:error.
You can make any exception you wish. The trick is to use the ExceptionSelector and tell it about your custom Exception:
Taken from the main default sitemap.xmap in Cocoon:
<!--+
| Exception selector : used in <map:handle> errors to build different pipelines
| depending on the error that occured.
| The configuration allows to associate a symbolic name to exception classes
| which is used in the <map:when> tests.
| An exception can also be "unrolled", meaning that cascaded exception will be checked.
+-->
<map:selector logger="sitemap.selector.exception" name="exception" src="org.apache.cocoon.selection.ExceptionSelector">
<exception class="org.apache.cocoon.ResourceNotFoundException" name="not-found"/>
<exception class="org.apache.cocoon.components.flow.InvalidContinuationException" name="invalid-continuation"/>
<!-- The statement below tells the selector to unroll as much exceptions as possible -->
<exception class="java.lang.Throwable" unroll="true"/>
</map:selector>
HTH,
Tony
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Lionel CRINE Ing�nieur Syst�mes documentaires Soci�t� : 4DConcept 22 rue Etienne de Jouy 78353 JOUY EN JOSAS Tel : 01.34.58.70.70 Fax : 01.39.58.70.70
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
