Exceptions

Memory Map

Objective

Following rules are described

  1. Item 69: Use exceptions only for exceptional conditions . . . . . . . 293
  2. Item 70: Use checked exceptions for recoverable conditions and
  3. runtime exceptions for programming errors . . . . . . . . . . 296
  4. Item 71: Avoid unnecessary use of checked exceptions . . . . . . . . 298
  5. Item 72: Favor the use of standard exceptions. . . . . . . . . . . . . . . . 300
  6. Item 73: Throw exceptions appropriate to the abstraction. . . . . . . 302
  7. Item 74: Document all exceptions thrown by each method. . . . . . 304
  8. Item 75: Include failure-capture information in detail messages. . 306
  9. Item 76: Strive for failure atomicity . . . . . . . . . . . . . . . . . . . . . . . 308
  10. Item 77: Don’t ignore exceptions . . . . . . . . . . . . . . . . . . . . . . . . . 310