What problem does it solve?
This Skill standardizes and unifies error handling across application boundaries by employing the Result Pattern, enabling consistent failure representation, wrapping error information, and separating error concerns from business logic.
Core Features & Use Cases
- Result-based flows: Apply a typed Result/Failure model to service and repository boundaries to represent success and failure explicitly.
- Failure object design: Implement a structured Failure class with Code, Message, TraceId, and extensibility data to carry rich error context.
- HTTP mapping & layering: Map FailureCode values to HTTP status responses in a clean, layered architecture (Repository, Handler, Controller, Middleware) for predictable client-facing errors.
- Reference patterns: Follow best practices and templates (e.g., Failure templates and pattern guidelines) to ensure consistent error handling across services.
Quick Start
Introduce a common Failure type and FailureCode, wire a global exception middleware, and refactor core paths to return Result/Failure through repository and service layers.