error-handling
Installation
SKILL.md
Error Handling Skill
Comprehensive, layered error handling for Next.js applications. This file holds the architecture and contract; copy-paste code is in the references.
- references/patterns.md — error-handling patterns by layer.
- references/examples.md — full worked examples (complete CRUD with errors).
- references/retry-patterns.md — retry, circuit breaker, resilience.
- references/validation-vs-runtime.md — validation vs runtime errors.
Philosophy
- Never expose internal errors to users — log details server-side, show friendly messages client-side.
- Use typed errors —
ServiceErrorfor any service layer,ActionResponsefor server actions. - Fail gracefully — error boundaries, fallback UI, retry mechanisms.
- Log everything — structured logging with context before returning an error.
- Provide feedback — toast notifications for user-facing errors.