Bertrand Delacretaz wrote:
Le 14 avr. 04, � 16:05, Ugo Cei a �crit :
...Indeed. That's why I propose that ProcessingException extends
CascadingRuntimeException, instead of CascadingException. This way,
you won't be forced to catch it (and catch ResourceNotFoundException)
if you don't need to and be tempted to wrap it or swallow it....
...The litmus test should be the following: can you recover from a
ResourceNotFoundException, in the general case? IMHO, no. Your best
course of action is to tell the user....
Ok, so we're getting much more specific that your original "use
unchecked exceptions everywhere" proposal (or my understanding of it),
aren't we?
IMHO coming up with specific rules about where to use which method
(unchecked exceptions, throws Exception, throws A,B,C) is much more
likely to be accepted by the community than general rules.
I don't mind a throws A,B,C if they extend a scoped base exception
(when it makes sense of course). But I prefer that we use one base
exception that is narrow enough to tell you the system the problem
happened in, but general enough to include a group of subexceptions.