Is this a valid case for catch Throwable?:

A utility class that meant to be subclassed.  It calls protected
methods that are meant to be overriden by subclasses.  Should those
method calls be wrapped in catch Throwable?

The argument is that the utility class has no control over the
subclass, and doesn't know what exceptions might be thrown, so we
catch Throwable to program defensively and handle the error.

The counter argument, the one I agree with, is that in most cases it
can be assumed that a method won't throw anything but checked
exceptions, and that catching root exception classes (e.g., Exception,
Throwable) clutters the code and can inadvertently hide bugs.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "The 
Java Posse" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/javaposse?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to