TIBCOSoftware / genxdm

GenXDM: XQuery/XPath Data Model API, bridges, and processors for tree-model neutral access to XML.
http://www.genxdm.org/
9 stars 4 forks source link

GenXDMException extends RuntimeException: is this correct? #72

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
$SUMMARY

Although we declare that we throw GenXDMException in most places where we use 
it:

1) we don't have to; and
2) we can throw it from wherever we want, anyway; and
3) nobody has to catch it, 'cause it's a runtime.

This may all be intended, but it isn't documented as intended.  An interesting 
experiment would be to change the extends clause to: extends Exception and see 
what breaks.

Do we need an exception of our very own, even?

Original issue reported on code.google.com by aale...@gmail.com on 8 Nov 2011 at 5:09

GoogleCodeExporter commented 9 years ago
David was fond of RuntimeException and eschewing checked exceptions.  Checked 
exceptions do make sense when you want to show foreseeable problems that the 
caller has to handle (IOException/user input error) and leave the rest 
(NullPointer; coding error) to be handled by higher levels.

It's a fine line and your experiment may be costly but I think own exception is 
needed for many cases.

Original comment by anli.shu...@gmail.com on 8 Nov 2011 at 5:18

GoogleCodeExporter commented 9 years ago
Not-a-bug. If someone cares, let them reopen.

Original comment by aale...@gmail.com on 26 Jul 2012 at 7:31