-
Website
http://andypalmer.com -
Original page
http://andypalmer.com/2008/09/checked-exceptions/ -
Subscribe
All Comments -
Community
-
Top Commenters
-
Andy Palmer
2 comments · 1 points
-
Rob Myers
1 comment · 1 points
-
tswicegood
1 comment · 1 points
-
-
Popular Threads
Next workshop?? :D
The point of checked exceptions is that it allows me to know all the paths out of a chunk of code, otherwise I have to assume that any method call can fail and over-protect the logic.
throw new RuntimeException(e);
Don't add and exception to the throws clause unless it will make sense to the caller. If it's a case that should never happen, or cannot be handled, wrap it in a RuntimeException, which effectively converts the checked exception to an unchecked one.
I don't see why an "ignores" clause couldn't be added to Java methods to do this wrapping automatically.