cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Vadim Gritsenko" <>
Subject New Source Interface & Exception Handling Issues
Date Thu, 06 Sep 2001 15:14:02 GMT

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)
2. Add "throws ProcessingException" to toSAX method of
XMLizable (to satisfy point 1)
3. Think about how to handle exception before writing
"throw new ...Exception("...", exception)"

I would love to hear suggestions from others on this topic.


To unsubscribe, e-mail:
For additional commands, email:

View raw message