I was actually thinking of doing the same thing... so create one block
responsible for handling any exceptions nicely.
Suppose you have a block called 'exceptionhandler' which contain a service
like below:
<map:match pattern="exceptionhandling-service">
<map:generate src="service-consumer:"/>
<map:transform src="exception2xhtml.xslt"/>
<map:serialize type="xhtml"/>
</map:match>
In your other block you should be able to do something like this but I haven't
tested it yet ;-)
<map:handle-errors>
<map:generate type="exception"/>
<map:transform type="servletService">
<map:parameter name="service"
value="servlet:exceptionhandler:/exceptionhandling-service "/>
</map:transform>
<map:serialize type="xhtml"/>
</map:handle-errors>
Cheers,
Robby
-----Original Message-----
From: Søren Krum [mailto:[email protected]]
Sent: Wednesday, June 03, 2009 11:17 AM
To: [email protected]
Subject: Blocks and error handling
Hi!
As i am right now hacking a bigger application in smaller pieces (while
upgrading from cocoon 2.1 to 2.2). While doing so, I would like to
handle most of the errors (probably all) in one central place.
Did anybody tried out something like "Forwarding Errors" to another
block? Could that be managed by a redirect which gets the error as a
parameter?
Any suggestions or best practise tips?
Søren D. Krum
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]