cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Vadim Gritsenko" <vgritse...@hns.com>
Subject New Source Interface & Exception Handling Issues
Date Thu, 06 Sep 2001 15:14:02 GMT
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)
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.

Regards,
Vadim

---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


Mime
View raw message