|
|
|||||||
|
I know it's an old post but... If the author really wanted to simplify the code - AND do the right thing at the same time - he should have not used the pointless checked exception handling at all. There is NO good way to use checked exceptions. Have a top-level handler for ALL unrecoverable exceptions, implement individual handlers for each error condition that is EXPECTED to happen according to the business requirements for your module - where it is appropriate to handle them, not at the source of the error. Make them runtime as well but expect them - b/c they represent legitimate use cases. If the error is not expected, it means your app has no alternative action for it in store, so let it propagate to the top-level catch that handles everything. Handling a specific checked exception is dangerous b/c it leaves a possibility of all other exceptions being not caught at all. Not to mention that most people have no idea what they are doing at all when they catch, swallow, or rethrow every damn checked exception, and what a mess that creates....urghhhh |