You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by m....@devote.nl on 2000/10/27 10:45:37 UTC

Exception handling and XObject

I am using XObjects to generate data from EJB calls into XML documents.
This process can result in different exceptions, however the toDom method
in the XObject interface does not declare any errors.

In other classes I choose to pass every exception to the XSP page and
handle it there.
If I want to achieve this in the toDom method, this means creating a
descendant of RuntimeException and wrapping my original exception with it.
This way I can throw the wrapped exception and handle it in XSP.

This seems like a diry workaround. Does anybody have another solution?

TIA
Michael Homeijer


Re: Exception handling and XObject

Posted by Jeremy Quinn <je...@media.demon.co.uk>.
At 10:45 +0200 27/10/00, m.homeijer@devote.nl wrote:
>I am using XObjects to generate data from EJB calls into XML documents.
>This process can result in different exceptions, however the toDom method
>in the XObject interface does not declare any errors.
>
>In other classes I choose to pass every exception to the XSP page and
>handle it there.
>If I want to achieve this in the toDom method, this means creating a
>descendant of RuntimeException and wrapping my original exception with it.
>This way I can throw the wrapped exception and handle it in XSP.
>
>This seems like a diry workaround. Does anybody have another solution?

I use XObject too.

In my about-to-be-released XSP Mailer TagLib, toDOM or toSAX call the
send() method, then output any errors (collected in a Hashtable) as XML
into the Node or DocumentHandler that they receive.

In the next version of the FP TagLib, the parent of each fp:tag is marked
with a unique ID attribute, then these IDs are used to mark the output
error XML, so that each error can be "linked" to the form element where it
happened.

Hope this helps

regards Jeremy
-- 
   ___________________________________________________________________

   Jeremy Quinn                                           Karma Divers
                                                       webSpace Design
                                            HyperMedia Research Centre

   <ma...@mac.com>     		 <http://www.media.demon.co.uk>
    <phone:+44.[0].20.7737.6831>        <pa...@sms.genie.co.uk>