What are you views on using CheckedExceptions and RuntimeExceptions in an application ? I've been advised to use a combination of both and, as far as I understand, you can have a chain of CheckedException calls being propagated up along with a RuntimeException.
Checked exceptions should only be thrown if you can reasonably expect the caller to handle them. Otherwise throw a RuntimeException (which doesn't require that you declare it or that the handler catch it. This is the approach that Spring JDBC takes).
More details from Sun here.
If a client can reasonably be expected to recover from an exception, make it a checked exception. If a client cannot do anything to recover from the exception, make it an unchecked exception.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With