Oct 22, 2018

[HDGEM] Eight guidelines of exception handling In Java

In Joshua Bloch's book, Effective Java, he described these eight guidelines of exception handling:
  1. Use exceptions only for exceptional scenarios.
  2. Use checked exceptions for recoverable conditions and runtime exceptions for programming errors.
  3. Avoid unnecessary use of checked exceptions.
  4. Favor the use of standard exceptions.
  5. Throw exceptions appropriate to the abstraction.
  6. Document all exceptions thrown by each method.
  7. Include failure-capture information in detail messages.
  8. Don't ignore exceptions.

Posted By Blogger to HDGEM at 1/22/2017 02:39:00 AM