When and what to throw

July 23, 2007

Interesting post from Elliotte Harold, proposing a new nomenclature for exceptions, whereby checked exceptions are referred to as “external” and runtime exceptions as “internal”.

The discussion is also interesting. Like Ingo, the guidance I’ve been giving is to only throw a checked exception if it’s conceivable that the caller could do something about it. This is fine, but not so useful for programmers who lack the experience to spot opportunities for good error handling. I’ll give the internal / external approach a bash and see how it goes with people.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: