error-handling
Installation
SKILL.md
Error Handling
Choose error mechanisms by recoverability and caller responsibility.
Workflow
-
Classify each error as domain, validation, application, infrastructure, programming defect, or fatal system condition.
-
Use typed
Result/Either-style returns for recoverable domain and validation errors. -
Use exceptions or panics for defects and truly exceptional infrastructure failures when callers cannot make a local decision.
-
Preserve causal context without leaking secrets.
-
Put retry, timeout, and circuit-breaker policy at integration boundaries.
Rules
- Domain errors should be explicit in function signatures where the language supports it.