cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tony Collen <colle...@umn.edu>
Subject Re: [A SOLUTION] Speicifed the error for the map:handle-error
Date Wed, 16 Jul 2003 17:10:28 GMT
Lionel Crine wrote:
> I found something working, but I think this is not clean!
> 
> For any Exception I throw a processingException.
> Then the <map:handle-errors> gets it.
> 
> lionel
> 
> 
> 
> At 16:03 16/07/2003 +0200, you wrote:
> 
>> Hi,
>>
>> I'd the <map:handle-error> to handle my custom exception (not only the 
>> 404 and 500).
>> Where can i do that ?
>> Is there something to overload?
>>
>> I read some post on the mailing, and wiki but nothing helps ?

Lionel,

You can do this in your sitemap:
<map:components>
	...

	<map:selector name="exception" src="org.apache.cocoon.selection.XPathExceptionSelector">
         	<exception name="my-exception" class="org.me.MyException"/>
       </map:selector>
	...
</map:components>


and then

     <map:handle-errors>
         <map:select type="exception">
             <map:when test="my-exception">
                 <map:generate src="foo.xml"/>
                 <map:transform src="whatever.xsl"/>
                 <map:serialize/>
             </map:when>
         </map:select>
     </map:handle-errors>

This seems to be fairly clean, IMO.


Tony


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


Mime
View raw message