error-handling

Guide .NET error handling with Result types, exceptions, and ProblemDetails mapping.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/jamesbondev/ai-dotfiles --skill error-handling-jamesbondev
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: error-handling
Source: https://github.com/jamesbondev/ai-dotfiles/tree/main/.github/skills/error-handling
Command: npx skills add https://github.com/jamesbondev/ai-dotfiles --skill error-handling-jamesbondev

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill addresses the common challenge of inconsistent and ineffective error handling in .NET applications, ensuring robust, traceable, and user-friendly error responses.

Core Features & Use Cases

  • Strategy Comparison: Provides a clear overview of different error handling patterns (Exceptions, Result types like OneOf/ErrorOr, FluentResults).
  • Best Practices Enforcement: Outlines critical rules for flagging issues like mixed approaches, swallowed exceptions, and missing correlation IDs.
  • Standardized Responses: Guides the mapping of errors to RFC 9457 ProblemDetails for consistent API error reporting.
  • Use Case: When reviewing a new API endpoint, use this Skill to ensure all error paths are handled correctly, mapped to appropriate HTTP statuses, and include a correlation ID for traceability.

Quick Start

Use the error-handling skill to review the error handling strategy in the current project.

Frequently Asked Questions about error-handling

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

FAQPage Schema
How do I standardize .NET API error responses using ProblemDetails?

Standardize .NET API error responses by mapping exceptions and errors to RFC 9457 ProblemDetails. This Skill guides consistent API error reporting and enforces best practices for robust, traceable responses.

What is the best way to choose between Result types and exceptions for .NET error handling?

Compare .NET error handling strategies by reviewing Exceptions, OneOf, ErrorOr, and FluentResults patterns. This Skill provides a clear overview to help you select and enforce a consistent approach for your application.

How do I add correlation IDs for traceable exception handling in .NET?

Add correlation IDs for traceable exception handling in .NET by following standardized error management patterns. This Skill enforces best practices to prevent swallowed exceptions and ensure traceability across distributed services.

Can I use this error handling guidance to review an existing .NET API endpoint?

Yes, you can use this guidance to review existing .NET API endpoints. The Skill flags mixed error handling approaches, swallowed exceptions, and missing correlation IDs, ensuring all error paths map to appropriate HTTP statuses.

What are common limitations of mixing Result types and exceptions in .NET?

Mixing Result types and exceptions in .NET creates inconsistent error management and reduces traceability. This Skill flags mixed approaches as a critical issue and enforces best practices to maintain standardized API error responses.