error-handling

v2026.09.25

Use when designing error hierarchies, implementing React error boundaries, adding retry logic or fallbacks, creating API error responses, integrating error tracking (Sentry), or improving user-facing error communication.

GitHub
安装命令
npx skhub add srstomp/error-handling
Markdown
SKILL.md

Error Handling

Design resilient applications through intentional error handling strategies. Errors are data, not just exceptions — design them intentionally.

Quick Decision Guide

SituationPatternReference
Typed error categoriesCustom error classeserror-patterns.md
Explicit handling (no throws)Result/Either typeerror-patterns.md
React component crashError boundaryreact-errors.md
API error responseStructured API errorsapi-errors.md
Network calls that failRetry with backoffrecovery-patterns.md
Unreliable downstream serviceCircuit breakerrecovery-patterns.md

Key Principles

  • Debuggable: Rich context, stack traces, correlation IDs
  • Recoverable: Retry logic, fallbacks, circuit breakers
  • User-friendly: Clear messages, recovery guidance, no leaked internals
  • Consistent: Same error shape across all API endpoints

Quick Start Checklist

  1. Define base AppError class with code and context
  2. Create domain-specific error subclasses
  3. Implement consistent API error response shape
  4. Add error boundaries at app, route, and component levels
  5. Set up error tracking (Sentry) with scrubbing

References

ReferenceDescription
error-patterns.mdCustom errors, Result types, error hierarchies
react-errors.mdError boundaries, Suspense, React error handling
api-errors.mdHTTP errors, response shapes, status codes
recovery-patterns.mdRetry, circuit breaker, fallbacks, degradation
overview.mdError types, Result pattern, user messages, tracking, anti-patterns
anti-rationalization.mdIron Law, common rationalizations, red flag STOP list for error handling discipline
tdd-patterns.mdTest-first patterns for error paths, retry logic, boundaries
review-checklist.mdError handling review checklist (classes, messages, recovery, tracking)

Runtime Notes

  • Claude Code: dispatch the relevant agent (yokay-implementer, yokay-fixer, yokay-spec-reviewer, or yokay-quality-reviewer) via the Task tool with subagent_type: "pokayokay:yokay-<name>".
  • Codex: there is no subagent dispatch. Execute the agent's role inline — read the corresponding agents/yokay-<name>.md and follow its Behavioral Defaults, Critical Rules, and Output Contract directly in the current session.
发现
标签

此技能尚未发布标签。

版本
最新版本元数据

版本

v2026.09.25

发布时间

2026年9月25日

分类

未分类

许可证

MIT

源路径

plugins/pokayokay/skills/error-handling

默认分支

master

最新提交

ef6a34d

Tree SHA

7e3eba3