Error Handling & Input Validation

Incorrect exception handling

Last updated: 4 Mar 2026

Definition

Catches are too broad, swallow errors, or retry non-retriable failures.

How to fix Incorrect exception handling?

Catch specific exceptions; rethrow or map appropriately; log with context; add tests that assert error paths

Symptoms

Observable signs that may indicate Incorrect exception handling:

  • Errors swallowed; system continues in corrupted state.
  • Generic catch blocks mask root causes.
  • Retries applied to non-retriable errors.

Example Errors:

  • catch (Exception e) { /* ignore */ }
  • Suppressed exception: original cause hidden
  • Retry storm detected