error-handling-patterns
错误处理模式 —— 异常分类体系、重试与降级策略、错误码规范与用户友好提示
Skill by Sweetteabittersugar
Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/sweetteabittersugar-error-handling-patterns
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions
What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.
- Tools
- No tools found
- Secrets
- None asked for
- Install scripts
- None found
Network hosts it talks to 1
codeload.github.com· found in install command
Files it touches
~/.claude/skills/error-handling-patterns
What's inside
- Skill name
error-handling-patterns- Description
- 错误处理模式 —— 异常分类体系、重试与降级策略、错误码规范与用户友好提示
- License
- MIT
- Instructions
- 32 lines in SKILL.md · view on GitHub
Files (2)
- SKILL.md
- SKILL.md.disabled
SKILL.md (first lines)
# 错误处理模式 ## 概述 提供覆盖应用全链路的错误处理策略,包含错误分类、重试与退避、降级兜底、熔断保护和用户提示规范。 ## 使用场景 - 设计全局异常处理机制 - API 调用频繁超时需要引入重试和熔断 - 用户反馈错误提示不友好或暴露内部信息 - 分布式事务中需要补偿和回滚策略 ## 核心原则 1. **错误分类先行**:区分可恢复错误(重试解决)、不可恢复错误(返回失败)、业务错误(提示用户)。 2. **重试必须带退避**:固定间隔重试会导致雪崩。指数退避 + 随机抖动是标准做法。 3. **熔断保护系统**:连续失败达到阈值后快速失败(fail-fast),避免级联故障扩散。 4. **用户提示安全第一**:对外错误消息不暴露堆栈、路径、SQL、密钥。内部日志可记录完整上下文。 5. **错误不丢失**:每个错误要么处理,要么向上传播,绝不静默 `pass` 或空 `catch`。 ## 实践要点 - **错误码规范**:全局统一错误码表,格式如 `MODULE_ERROR_CODE`(`USER_001`, `ORDER_023`) - **重试策略**:网络类错误最多 3 次重试,退避 1s/2s/4s + 随机 0-500ms 抖动 - **熔断器三态**:关闭(正常)→ 打开(快速拒绝)→ 半开(探测恢复) - **幂等设计**:重试操作必须幂等,通过幂等键防止重复处理 ## 检查清单 - [ ] 是否有全局异常拦截层统一处理未被捕获的错误? - [ ] 对外错误消息是否确认无敏感信息泄露? - [ ] 外部调用是否有合理的超时、重试和熔断机制? - [ ] 分布式操作是否有补偿/回滚策略? - [ ] 错误日志是否包含足够的排查上下文(请求 ID、用户 ID、时间戳)?
From Sweetteabittersugar/agency, MIT.
More from Sweetteabittersugar/agency
- 0.555score
architecture-patterns
Sweetteabittersugar
架构设计模式参考 —— 常见架构风格的决策框架、优劣对比与适用场景
SkillBFreshness: B★ 3Claude Code +9 - 0.555score
browser-compatibility
Sweetteabittersugar
浏览器兼容性检查 —— 目标浏览器覆盖率、特性支持度验证与降级策略
SkillBFreshness: B★ 3Claude Code +9 - 0.555score
caching-strategy
Sweetteabittersugar
缓存策略参考 —— 多级缓存架构、失效策略、缓存穿透/击穿/雪崩防护
SkillBFreshness: B★ 3Claude Code +9 - 0.555score
database-design
Sweetteabittersugar
数据库设计规范 —— 范式设计、索引策略、分库分表、命名约定与迁移管理
SkillBFreshness: B★ 3Claude Code +9 - 0.555score
dependency-audit
Sweetteabittersugar
依赖审计方法论 —— CVE 扫描、许可证合规、版本锁定与升级策略
SkillBFreshness: B★ 3Claude Code +9 - 0.555score
docker-patterns
Sweetteabittersugar
Docker 最佳实践 —— 多阶段构建、镜像层优化、安全运行、编排模式
SkillBFreshness: B★ 3Claude Code +9 - 0.555score
e2e-testing
Sweetteabittersugar
端到端测试实战 —— 关键用户流程覆盖、测试数据管理、环境隔离与 Playwright/Cypress 最佳实践
SkillBFreshness: B★ 3Claude Code +9 - 0.555score
health-check-patterns
Sweetteabittersugar
健康检查模式 —— 存活探针、就绪探针、依赖健康检查与服务健康度仪表板
SkillBFreshness: B★ 3Claude Code +9 - 0.555score
microservices
Sweetteabittersugar
微服务架构模式 —— 服务拆分原则、通信模式、数据一致性与治理框架
SkillBFreshness: B★ 3Claude Code +9 - 0.555score
parallel-execution
Sweetteabittersugar
并行执行方法论 —— 独立任务识别、并行策略、结果合并与冲突避免
SkillBFreshness: B★ 3Claude Code +9 - 0.555score
query-optimization
Sweetteabittersugar
查询优化指南 —— 慢查询分析、索引调优、执行计划解读与 N+1 问题治理
SkillBFreshness: B★ 3Claude Code +9 - 0.555score
rag-patterns
Sweetteabittersugar
RAG 模式 —— 检索增强生成架构设计、分块策略、向量检索优化与评估方法
SkillBFreshness: B★ 3Claude Code +9
Signals
- Stars
- 3
- Forks
- 1
- Open issues
- 0
- Last commit (this folder)
- Jun 10, 2026 (4 months ago)
- Last release
- Aug 24, 2026 (2 months ago)
From GitHub (fetched Oct 24, 2026).
Details
- License
- MIT
- Repository
- github.com/Sweetteabittersugar/agency
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
More from Sweetteabittersugar
- 0.555score
browser-compatibility
Sweetteabittersugar
浏览器兼容性检查 —— 目标浏览器覆盖率、特性支持度验证与降级策略
SkillBFreshness: B★ 3Claude Code +9 - 0.555score
caching-strategy
Sweetteabittersugar
缓存策略参考 —— 多级缓存架构、失效策略、缓存穿透/击穿/雪崩防护
SkillBFreshness: B★ 3Claude Code +9 - 0.555score
database-design
Sweetteabittersugar
数据库设计规范 —— 范式设计、索引策略、分库分表、命名约定与迁移管理
SkillBFreshness: B★ 3Claude Code +9 - 0.555score
dependency-audit
Sweetteabittersugar
依赖审计方法论 —— CVE 扫描、许可证合规、版本锁定与升级策略
SkillBFreshness: B★ 3Claude Code +9 - 0.555score
docker-patterns
Sweetteabittersugar
Docker 最佳实践 —— 多阶段构建、镜像层优化、安全运行、编排模式
SkillBFreshness: B★ 3Claude Code +9 - 0.555score
architecture-patterns
Sweetteabittersugar
架构设计模式参考 —— 常见架构风格的决策框架、优劣对比与适用场景
SkillBFreshness: B★ 3Claude Code +9
Cite this page
error-handling-patterns skill. Agent Mart. https://agentmart.dev/skills/sweetteabittersugar-error-handling-patterns (last updated 2026-10-24)