You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Søren Krum <so...@uninett.no> on 2009/06/03 11:17:05 UTC

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: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: Blocks and error handling

Posted by Søren Krum <so...@uninett.no>.
hi!

thanks for the suggestion, I was afraid that such a solution would 
come... :-)

My original error handling does something like this:


<map:handle-errors>
        <map:select type="exception">
          <map:when test="not-found">
 ...
          </map:when>
          
          <map:when test="premature">
...
          </map:when>
          
          <map:when test="citrix-overload">

So it would be interesting that the error / the exception survive, or is there a quick way to change the route of processing in a pipeline taking  the already produced content into account? Then i could take the class attribute from the exception-report.

Looks like i have to mess up all my sitemaps :-(

Best Regards

Søren

 





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


RE: Blocks and error handling

Posted by Robby Pelssers <ro...@ciber.com>.
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:soren.krum@uninett.no] 
Sent: Wednesday, June 03, 2009 11:17 AM
To: users@cocoon.apache.org
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: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


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