freeskillv2.0.0✓ verified
error-handling-patterns
How to handle errors explicitly and consistently across an app — validate at boundaries, classify operational vs programmer errors, add context while propagating, retry transient failures with backoff, and never swallow. Covers JS/Python/Go/Rust patterns with runnable checks.
$npx vanara install error-handling-patterns
Free & open source (Apache-2.0) — view the source on GitHub.
Overview
Errors are part of the contract, not an afterthought. A robust system handles errors where it can act, propagates them where it can't, and never lets a failure vanish silently. This skill is the deep reference: the decisions, the trade-offs, and the anti-patterns. Heavy detail lives in references/, copy-paste material in examples/, and a runnable linter for swallowed errors in scripts/.
What it covers
- The five rules
- Adding context without losing the cause
- Retrying transient failures
- Error Taxonomy — Operational vs Programmer Errors
- Language Patterns — Exceptions vs Result vs Panics
- Retry & Backoff