## Lesson — Custom database errors should include specific

**Tags:** error-handling, dx, database

Custom database errors should include specific machine-readable codes like `DATABASE_MISMATCH` alongside human-readable messages. This enables programmatic recovery, allowing the CLI or UI to suggest specific corrective actions like a forced re-index.
