zhanghandong avatar

M13 Domain Error

Domain error handling strategy resource for Rust developers designing error types and recovery mechanisms. It addresses who needs to handle errors (end users, developers, or operations) and how to categorize them (transient vs. permanent, user-facing vs. internal) to determine appropriate recovery strategies like retries, fallbacks, and circuit breakers. The skill solves the problem of inconsistent error handling across application layers by providing a framework that connects domain requirements to implementation patterns.

skills.sh installs
738
GitHub stars
1.3K
last updated
Jul 14, 2026

Install

$ npx -y skills add zhanghandong/rust-skills --skill m13-domain-error --agent claude-code

Installs into .claude/skills of the current project.

Files

Domain Error Strategy

Layer 2: Design Choices

Core Question

Who needs to handle this error, and how should they recover?

Before designing error types:

  • Is this user-facing or internal?
  • Is recovery possible?
  • What context is needed for debugging?

Error Categorization

Error TypeAudienceRecoveryExample
User-facingEnd usersGuide actionInvalidEmail, NotFound
InternalDevelopersDebug infoDatabaseError, ParseError
SystemOps/SREMonitor/alertConnectionTimeout, RateLimited
TransientAutomationRetryNetworkError, ServiceUnavailable
PermanentHumanInvestigateConfigInvalid, DataCorrupted

Thinking Prompt

Before designing error types:

  1. Who sees this error?

    • End user → friendly message, actionable
    • Developer → detailed, debuggable
    • Ops → structured, alertable
  2. Can we recover?

    • Transient → retry with backoff
    • Degradable → fallback value
    • Permanent → fail fast, alert

Sponsors

Details

Repository
github.com/zhanghandong/rust-skills
Categories
Debugging, Rust

More from zhanghandong/rust-skills

All 34

Recommended

More Debugging
1joellewis avatarperformance-reportingjoellewis/finance_skillsGenerate clear, accurate performance reports for investment portfolios with benchmarks, attribution, and risk dashboards. Use when the user asks about portfolio729skills.sh installs
2joellewis avatarperformance-attributionjoellewis/finance_skillsDecompose portfolio returns into explainable components to identify where value was added or lost. Use when the user asks about Brinson attribution, allocation 705skills.sh installs
3aaronontheweb avatardatabase-performanceaaronontheweb/dotnet-skillsDatabase access patterns for performance. Separate read/write models, avoid N+1 queries, use AsNoTracking, apply row limits, and never do application-side joins700skills.sh installs
4aaronontheweb avatartype-design-performanceaaronontheweb/dotnet-skillsDesign .NET types for performance. Seal classes, use readonly structs, prefer static pure functions, avoid premature enumeration, and choose the right collectio684skills.sh installs
5aj-geddes avatarperformance-testingaj-geddes/useful-ai-promptsDesign and execute performance tests to measure response times, throughput, and resource utilization. Use for performance test, load test, JMeter, k6, benchmark609skills.sh installs
6jeremylongshore avatarperformance-lighthouse-runnerjeremylongshore/claude-code-plugins-plus-skillsManage performance lighthouse runner operations. Auto-activating skill for Frontend Development. Triggers on: performance lighthouse runner, performance lightho604skills.sh installs