In Joshua Bloch's book, Effective Java, he described these eight guidelines of exception handling:
- Use exceptions only for exceptional scenarios.
- Use checked exceptions for recoverable conditions and runtime exceptions for programming errors.
- Avoid unnecessary use of checked exceptions.
- Favor the use of standard exceptions.
- Throw exceptions appropriate to the abstraction.
- Document all exceptions thrown by each method.
- Include failure-capture information in detail messages.
- Don't ignore exceptions.
Posted By Blogger to HDGEM at 1/22/2017 02:39:00 AM