From: Daniel Pitts on
On 5/19/2010 9:59 AM, Lew wrote:
> gk wrote:
>> is it java.lang.Exception ? or something else ?
>
> *All* exceptions in Java are 'java.lang.Exception's. They may be
> something else as well. What does the documentation say for your platform?
Actually, they can also be Errors, or any other Throwable not derived
from Error or Exception.

Also, when someone asks what exception is being thrown, it takes very
little imagination to expect they meant the most specifically guaranteed
type, not the most generally guaranteed type.

--
Daniel Pitts' Tech Blog: <http://virtualinfinity.net/wordpress/>
From: Lew on
gk wrote:
>>> is it java.lang.Exception ? or something else ?

Lew wrote:
>> *All* exceptions in Java are 'java.lang.Exception's. They may be
>> something else as well. What does the documentation say for your
>> platform?

Daniel Pitts wrote:
> Actually, they can also be Errors, or any other Throwable not derived
> from Error or Exception.

If they're "exceptions", then by definition they descend from Exception. They
cannot be any other Throwable not derived from Exception.

> Also, when someone asks what exception is being thrown, it takes very
> little imagination to expect they meant the most specifically guaranteed
> type, not the most generally guaranteed type.

Programming is a discipline of precision. I can imagine or expect that all
sorts of things are meant, but I have to ensure I am not making an unfounded
assumption. Thus, I replied in a way that covers both eventualities.

--
Lew