cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Laurent Medioni" <lmedi...@odyssey-group.com>
Subject RE: exception handling sitemap
Date Thu, 15 Apr 2010 08:43:50 GMT
Hi,
Here is an extract of what we do in 2.1.11 (but we are not using the exception handler):

<map:handle-errors>
	<map:generate type="notifying" />
	<map:transform src="presource:stylesheet/error2xml.xsl" />
	<map:serialize type="html" status-code="500" />
</map:handle-errors>

With "notifying" generator being
<!-- The notifying generator can only be used in a <handle-errors> section : it produces
an XML representation of the exception that caused the error handler to be executed -->
<map:generator name="notifying" src="org.apache.cocoon.sitemap.NotifyingGenerator" />

And use xmlns:error="http://apache.org/cocoon/error/2.1" in error2xml.xsl to see get what
is coming out of the notifier...

Cheers,
Laurent

-----Original Message-----
From: Robby Pelssers [mailto:robby.pelssers@ciber.com] 
Sent: jeudi, 15. avril 2010 10:32
To: users@cocoon.apache.org
Subject: exception handling sitemap 

Hi all,

I was wondering if I can access the exception thrown in the exception handler... What I would
like to do is generate a generic xml document containing info about the exception... 

If it is possible, how can I accomplish this?


<map:handle-errors>
  <map:select type="exception">
    <map:when test="sax">
      <!-- forward to generic xml exception page -->
    </map:when>
    <map:when test="fileNotFound">
      <!-- forward to generic xml exception page -->      
    </map:when>	      	      
  </map:select>
</map:handle-errors>


<!-- jx template -->
<Exception>
  <Class>${exception.class.name}</Class>
  <Message>${exception.message}</Message/>
  <Cause>${exception.cause}</Cause>
</Exception>


Kind regards,
Robby

____________________________________________________________

• This email and any files transmitted with it are CONFIDENTIAL and intended
  solely for the use of the individual or entity to which they are addressed.
• Any unauthorized copying, disclosure, or distribution of the material within
  this email is strictly forbidden.
• Any views or opinions presented within this e-mail are solely those of the
  author and do not necessarily represent those of Odyssey Financial
Technologies SA unless otherwise specifically stated.
• An electronic message is not binding on its sender. Any message referring to
  a binding engagement must be confirmed in writing and duly signed.
• If you have received this email in error, please notify the sender immediately
  and delete the original.
Mime
View raw message