The choice between excluding or excluding an exception is always somewhat subjective:
If the exception indicates an error or some kind of failure that is "possibly not being recovered," then an unchecked exception is thrown.
If the exception indicates an error that is likely to be recovered, then a valid exception is appropriate.
This is more difficult in cases where there is a general exception with a large number of subclasses. Some of these subclasses may be bugs, or they may be restored. At this point, the developer must evaluate the relative probability of the various cases ... in all known / predicted exception subtypes.
In this case, the engineers at Sun and Google came to different conclusions. But note that Google engineers had a big advantage that Sun engineers didn't have. They could take a look at the Java design and see for themselves how well it worked with the proven SQLException .
Although I read somewhere that checked exceptions are "out" ...
There are many developers who want all Java exceptions to be disabled so that they donβt have to force them to be eliminated. There are many other developers who still think that Java handled checked exceptions correctly ... although there were a few cases where the wrong choice was made (in retrospect).
This is debatable.
Am I missing something? They are different from each other, what do I think?
Not really. The two exception hierarchies serve pretty much the same purpose ... despite the differences in javadoc class descriptions.
source share