refactor-state-errors
CommunityRefactor errors into domain enums.
Authormoriyoshi
Version1.0.0
Installs0
System Documentation
What problem does it solve?
Refactor a service crate's state module to use domain-specific error enums instead of constructing end-user-facing error structs (error_type/message/status) and move error shaping into the handler layer.
Core Features & Use Cases
- Introduces a domain-focused error enum using thiserror to represent service errors without HTTP/wire knowledge.
- Replaces all {Service}Error { error_type: ..., message: ..., status: ... } constructions in state.rs with explicit enum variants.
- Updates the handler error-shaping function to exhaustively map enum variants to wire responses, while using err.to_string() for the message to keep a single source of truth.
Quick Start
Replace end-user error structs in state.rs with a domain-specific error enum and move domain-to-wire error mapping into handlers.rs.
Dependency Matrix
Required Modules
None requiredComponents
Standard package💻 Claude Code Installation
Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.
Please help me install this Skill: Name: refactor-state-errors Download link: https://github.com/moriyoshi/winterbaume/archive/main.zip#refactor-state-errors Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
Agent Skills Search Helper
Install a tiny helper to your Agent, search and equip skill from 471,000+ vetted skills library on demand.