posted 17 years ago
The ones to be extra-careful of are Exception and Throwable.
There are not very many cases where it is valid to catch Exception (a lot of the time, people are just being lazy and not listing the true set of exceptions). There are only a very few cases where it is valid to catch Throwable.
However, if you do decide to catch Exception or Throwable, be aware that you will catch things that would normally sail straight on through, such as RuntimeException (and all subclasses) and Error (and all subclasses). That is often not what you want.
I've often thought it is a shame that Java checked exceptions descend from the same superclass (Exception) as RuntimeException. Does anyone know why they didn't make Exception abstract and then introduce a CheckedException subclass, from which all checked exceptions would descend?
Betty Rubble? Well, I would go with Betty... but I'd be thinking of Wilma.