error-handling

Convert .NET 10 API failures into RFC 9457 ProblemDetails responses.

1|Updated Mar 27, 2026
One-click install
npx skills add https://github.com/Maj3D10/Training-Platform --skill error-handling-maj3d10
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: error-handling
Source: https://github.com/Maj3D10/Training-Platform/tree/main/.agent/skills/error-handling
Command: npx skills add https://github.com/Maj3D10/Training-Platform --skill error-handling-maj3d10

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill helps you design and implement reliable error handling in .NET 10 APIs so failures become consistent, structured, and predictable responses instead of ad-hoc messages.

Core Features & Use Cases

  • Result pattern for expected failures: Model business outcomes (e.g., not found, validation failure) without throwing exceptions.
  • RFC 9457 ProblemDetails everywhere: Return errors in a standardized contract with type, title, status, detail, and optional per-field errors.
  • Global exception handling for unexpected failures: Convert unhandled exceptions into ProblemDetails while avoiding sensitive information leakage.
  • FluentValidation with endpoint filters: Validate requests at the API boundary and return validation problems cleanly.
  • Typed error-to-HTTP mapping: Use strongly typed error objects/enums to translate domain errors into correct HTTP status codes.

Quick Start

When implementing an API endpoint, ask the AI to create a Result-based flow that converts known failures to ProblemDetails (RFC 9457) and installs a global exception handler for unexpected exceptions.

Frequently Asked Questions about error-handling

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

FAQPage Schema
How do I standardize API error handling in .NET 10 to return RFC 9457 ProblemDetails?

Standardize API error handling in .NET 10 by converting both expected failures and unexpected runtime crashes into RFC 9457 ProblemDetails responses. This approach ensures predictable error contracts with appropriate HTTP status codes and validation details.

What is the best way to handle expected business failures without throwing exceptions?

Handle expected business failures without throwing exceptions by implementing the Result pattern. This lets you model outcomes like validation or not-found errors, which are then mapped into structured RFC 9457 ProblemDetails responses.

How do I integrate FluentValidation at the API boundary to return validation problems?

Integrate FluentValidation at the API boundary using endpoint filters to validate requests. This setup cleanly intercepts invalid requests and returns structured validation problems within the standardized RFC 9457 response contract.

Why do I need a global exception handler if I already use the Result pattern?

A global exception handler is needed to catch unexpected runtime crashes that bypass the Result pattern. It converts unhandled exceptions into ProblemDetails responses securely, preventing sensitive information leakage while maintaining a consistent API error contract.

How does typed error-to-HTTP mapping work for domain errors?

Typed error-to-HTTP mapping uses strongly typed error objects or enums to translate specific domain failures into correct HTTP status codes. This ensures your API returns accurate, structured RFC 9457 ProblemDetails payloads for every known error scenario.