You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-dev@xerces.apache.org by Andy Clark <an...@apache.org> on 2001/05/08 04:48:11 UTC

[Xerces2] throws SAXException

We've had some discussions online and offline regarding using
the "throws SAXException" throughout the Xerces2 API. The idea
was to replace them with a RuntimeException so that the need
to catch the SAXException doesn't ripple through the code.

After much browbeating, I am now in agreement. :)

I plan to create an XNIException class that extends the Java
RuntimeException (much like DOMException) and replace the
"throws SAXException" clause on all of the XNI API to use the
XNIException. This will allow people to explicitly catch the
exception if they want to but, being of type RuntimeException,
doesn't force them to catch it.

I'll be making the change throughout the code (hopefully)
later today.

-- 
Andy Clark * IBM, TRL - Japan * andyc@apache.org

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


Re: [Xerces2] throws SAXException

Posted by Andy Clark <an...@apache.org>.
Petr Kuzel wrote:
>   yes, just a note. The configuration (parser) should definitely
> throw checked exception i.e. SAXException to force user handle it.
> Regarding XNI callback interfaces, no objection.

I had the same thought. I've already committed the changes to the
Xerces2 code. There were places where I had to catch SAXExceptions
and then turn around and wrap them with an XNIException but I
think that it will make things easier in the long run.

-- 
Andy Clark * IBM, TRL - Japan * andyc@apache.org

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


Re: [Xerces2] throws SAXException

Posted by Petr Kuzel <Pe...@sun.com>.
Hi,

  yes, just a note. The configuration (parser) should definitely
throw checked exception i.e. SAXException to force user handle it.
Regarding XNI callback interfaces, no objection.

  Cc. 


Andy Clark wrote:
> 
> We've had some discussions online and offline regarding using
> the "throws SAXException" throughout the Xerces2 API. The idea
> was to replace them with a RuntimeException so that the need
> to catch the SAXException doesn't ripple through the code.
> 
> After much browbeating, I am now in agreement. :)
> 
> I plan to create an XNIException class that extends the Java
> RuntimeException (much like DOMException) and replace the
> "throws SAXException" clause on all of the XNI API to use the
> XNIException. This will allow people to explicitly catch the
> exception if they want to but, being of type RuntimeException,
> doesn't force them to catch it.
> 
> I'll be making the change throughout the code (hopefully)
> later today.

-- 
<address>
<a href="mailto:pkuzel@netbeans.com">Petr Kuzel</a>, Sun Microsystems
: <a href="http://www.sun.com/forte/ffj/ie/">Forte Tools</a>
: XML and <a href="http://jini.netbeans.org/">Jini</a> modules</address>

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