Return-Path: Delivered-To: apmail-xml-cocoon-dev-archive@xml.apache.org Received: (qmail 91212 invoked by uid 500); 6 Sep 2001 15:34:24 -0000 Mailing-List: contact cocoon-dev-help@xml.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: list-post: Reply-To: cocoon-dev@xml.apache.org Delivered-To: mailing list cocoon-dev@xml.apache.org Received: (qmail 91150 invoked from network); 6 Sep 2001 15:34:24 -0000 From: "Carsten Ziegeler" To: Subject: AW: New Source Interface & Exception Handling Issues Date: Thu, 6 Sep 2001 17:35:16 +0200 Message-ID: MIME-Version: 1.0 X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2911.0) In-Reply-To: X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 Importance: Normal X-MIMETrack: Itemize by SMTP Server on PBSN1/Systeme und Netzwerke(Release 5.0.5 |September 22, 2000) at 06.09.2001 17:34:22, Serialize by Router on PBSN1/Systeme und Netzwerke(Release 5.0.5 |September 22, 2000) at 06.09.2001 17:34:23, Serialize complete at 06.09.2001 17:34:23 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="iso-8859-1" X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N > Vadim Gritsenko wrote: > > Cocooners, > > After migrating to new Source interface (extended from > XMLizable), certain exception handling issues arised: > > o Source is unable to throw ProcessingException anymore > (from toSAX method). > > Result (in SitemapSource): > > o ProcessingException is wrapped into SAXException > > But, getInputSource/getInputStream still can throw > ProcesingException. Result: > > o ProcessingException is wrapped into SAXException, which is > wrapped into ProcessingException (again) > > As a result, Sitemap might get either SAXException[ProcessingException], > or even ProcessingException[SAXException[ProcessingException]], > which makes exception handling code ugly and unclear. > > Same story applies to FileGenerator and may be to other > components as well. > > Proposed solution: > 1. Preserve meaningful exceptions up to the exception > handling point (sitemap) +1 > 2. Add "throws ProcessingException" to toSAX method of > XMLizable (to satisfy point 1) +1, AFAIR the old stream() method did throw the ProcessingException. Carsten > 3. Think about how to handle exception before writing > "throw new ...Exception("...", exception)" > > I would love to hear suggestions from others on this topic. > > Regards, > Vadim > > --------------------------------------------------------------------- > To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org > For additional commands, email: cocoon-dev-help@xml.apache.org > > --------------------------------------------------------------------- To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org For additional commands, email: cocoon-dev-help@xml.apache.org