csharp-error-handling
CommunityStandardize C# exceptions and API errors.
Software Engineering#csharp#exception-handling#result-pattern#aspnet-core#problemdetails#guard-clause
AuthorCloudyWing
Version1.0.0
Installs0
System Documentation
What problem does it solve?
This Skill provides concise, opinionated rules and examples to ensure C# projects use correct exception types, guard clauses, try/catch patterns, global error handling, and RFC-compliant ProblemDetails responses, reducing inconsistent error handling and fragile APIs.
Core Features & Use Cases
- Standardize when to throw exceptions versus return values and promote guard clauses at method entry to avoid nested control flow.
- Recommend specific exception types, best practices for custom exceptions, proper rethrowing, and forbidding empty catch blocks.
- Guide ASP.NET Core global error handling with IExceptionHandler, ProblemDetails serialization, handler chains, and async/cancellation handling.
- Common uses: code reviews, API refactors, implementing consistent error-response layers, and adopting the Result Pattern in services.
Quick Start
Review this ASP.NET Core endpoint and refactor its exception handling to use guard clauses, correct exception types, proper rethrowing, and standardized ProblemDetails responses.
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: csharp-error-handling Download link: https://github.com/CloudyWing/ai-dotfiles/archive/main.zip#csharp-error-handling 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.