What problem does it solve?
Error handling in .NET often becomes inconsistent, leaking internal exceptions to clients and making it hard to model expected failures like not found, validation errors, and business rule conflicts.
Core Features & Use Cases
- Typed result-based flows: Use
Result<TValue, TError> to represent expected domain outcomes without throwing for normal control flow.
- RFC 7807 ProblemDetails responses: Return standardized
ProblemDetails payloads for 4xx/5xx responses from ASP.NET Core.
- Global exception boundaries: Centralize unhandled exception handling at the HTTP boundary (and job boundaries) while keeping service/repository layers clean.
- Typed error records: Define discriminated domain error records (e.g., NotFound, Conflict, Forbidden, Validation) to enable precise HTTP mapping.
Quick Start
Ask an AI to refactor your service and API layer to return Result<T, DomainError> for domain failures and map those errors to ProblemDetails using a global exception handler.