Return-Path: Mailing-List: contact cocoon-users-help@xml.apache.org; run by ezmlm Delivered-To: mailing list cocoon-users@xml.apache.org Received: (qmail 47685 invoked from network); 29 Oct 2000 12:53:37 -0000 Received: from tele-post-20.mail.demon.net (194.217.242.20) by locus.apache.org with SMTP; 29 Oct 2000 12:53:37 -0000 Received: from media.demon.co.uk ([158.152.20.147] helo=[192.168.0.2]) by tele-post-20.mail.demon.net with esmtp (Exim 2.12 #2) id 13prxs-0004gm-0K for cocoon-users@xml.apache.org; Sun, 29 Oct 2000 12:53:32 +0000 Mime-Version: 1.0 X-Sender: media@pop3.demon.co.uk Message-Id: In-Reply-To: References: Date: Sun, 29 Oct 2000 12:48:18 +0000 To: cocoon-users@xml.apache.org From: Jeremy Quinn Subject: Re: Exception handling and XObject Content-Type: text/plain; charset="us-ascii" X-Spam-Rating: locus.apache.org 1.6.2 0/1000/N 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