Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: [xml-dev] SAXException, checked, buy why?

From: Karl Waclawek <karl@--------.--->
To: xml-dev@-----.---.---
Date: 1/3/2005 2:12:00 PM
Alan Gutierrez wrote:

>>It may be Java-oriented because I don't understand the problem.
>>Speaking for the Python case, since you don't have to declare
>>exceptions, the handler can throw anything it pleases, which, if not
>>handled by the driver falls to the original parse-calling code.
> 
> 
>     I'm not Python-oriented, so I might be making hash of this
>     response, but I think this is a generic concern.
> 
>     Assume no checked exceptions. That is some Java hand-wringing
>     that I'll discuss with Java developers if they are interested.
>     
>     <java-specific-musing boring-for="Uche">
<snip>
>     </java-specific-musing>
>         
>     How do you provide the fellow who invokes the event conduit with
>     a means to intercept exceptions at the event handler?
>     
>     Say I've a content handler that likes to open files. The action
>     to take when a file is not found could be to skip it an move on,
>     or it could be that the file can be fabricated real quick, or it
>     could be that processing has to abort via an exception.
>     
>     This is an application descision. How does the application
>     developer configure the content handler so that the exceptional
>     condition is handled during the event?

I am not sure I understand this question, as the answer I am thinking
of is trivial:

A SAX event handler can handle exceptions thrown by the calls it makes.
Or it can let them escape. Depends on whether it wants to "notify"
the event generator or not. How is that not possible in Java?

Apart from the above, consider the case of a chain of content handlers
(a "pipeline"). If one link in the chain throws an exception, the links
that are "downstream" get no notification at all (if they are even called)
as one does not "bubble" exceptions down. Each of the downstream
handlers might throw another exception. Maybe in that case event
handlers should avoid throwing exceptions at all, and rather
notify an error handler.

Karl


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent