m13-domain-error

Design domain error handling for Rust applications with error categorization and recovery strategies.

1.4k|110|Updated Jan 17, 2026
One-click install
npx skills add https://github.com/actionbook/rust-skills --skill m13-domain-error-actionbook
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: m13-domain-error
Source: https://github.com/actionbook/rust-skills/tree/main/skills/m13-domain-error
Command: npx skills add https://github.com/actionbook/rust-skills --skill m13-domain-error-actionbook

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps architects and developers design robust domain error handling by guiding how to categorize errors, determine recovery strategies, and structure error information for debugging and user messaging.

Core Features & Use Cases

  • Domain-aware error taxonomy: user-facing, internal, system, transient, and permanent errors with clear semantics.
  • Recovery strategies: retry, fallback, circuit breaker, and graceful degradation with practical Rust examples.
  • Design guidance: how to propagate context (anyhow::Context) and how to map business rules to technical error models.
  • Use Case: when building a financial service, apply the framework to categorize errors from input validation to downstream service failures and present actionable messages.

Quick Start

Design a domain error hierarchy for a payment service that separates user-facing messages from internal logs.

Frequently Asked Questions about m13-domain-error

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I design domain error handling in Rust for API services and background workers?

To design domain errors in Rust, use a layered taxonomy separating user-facing, internal, system, transient, and permanent errors. This approach maps business rules to technical error models, ensuring clear recovery strategies and observability across API services and background workers.

What is the best way to categorize transient and permanent errors in Rust?

Categorizing transient and permanent errors in Rust involves distinguishing temporary failures like downstream timeouts from permanent ones like invalid input. This Skill provides a domain-aware taxonomy to classify errors, enabling appropriate recovery strategies such as retry or circuit breaker patterns.

How do thiserror and anyhow work together for Rust error propagation?

Using thiserror and anyhow together in Rust allows you to define custom domain error types while easily propagating context. This Skill demonstrates how to map business rules using thiserror for structured errors and anyhow::Context for layered traceability from domain constraints to implementation.

When should I apply a circuit breaker or retry pattern for Rust error handling?

You should apply a circuit breaker or retry pattern in Rust error handling when dealing with transient errors like downstream service failures. This Skill outlines recovery strategies including retry, fallback, and graceful degradation with practical Rust examples for robust service architecture.

Can I use this domain error framework for a financial service in Rust?

Yes, you can use this domain error framework for a financial service in Rust. It provides guidance on separating user-facing messages from internal logs, categorizing errors from input validation to downstream service failures, and presenting actionable messages to users.