> > I've just noticed that XMLDBException (in the current Java implementation > > of the API) is currently a subclass of RuntimeException. Shouldn't it be > > a subclass of Exception instead? > > > > That depends on whether you think exceptions should be checked or not. > Since every method throws XMLDBException my feeling was that having to > deal with checked exceptions would be problematic since there is no > granularity in the level of exception thrown. This can certainly be > changed if it is the wrong approach.
I see your point. But if you look at java.sql.* you will see that SQLException is extended from Exception, not RuntimeException. SQLException is the equivalent of XMLDBException. It forces the programmer to deal with problems that can happen during the use of an API. The application still has the choice to "convert" an Exception into a RuntimeException. Maybe it would help to define two Exception classes, one for things such as configuration or networking errors (RuntimeException) and another (Exception) for things such as syntax errors in XPath statements or invalid XML. Just an idea... Jeremias M�rki mailto:[EMAIL PROTECTED] OUTLINE AG Postfach 3954 - Rhynauerstr. 15 - CH-6002 Luzern Fon +41 (41) 317 2020 - Fax +41 (41) 317 2029 Internet http://www.outline.ch ---------------------------------------------------------------------- Post a message: mailto:[EMAIL PROTECTED] Unsubscribe: mailto:[EMAIL PROTECTED] Contact adminstrator: mailto:[EMAIL PROTECTED] Read archived messages: http://archive.xmldb.org/ ----------------------------------------------------------------------
