senrecep/csharpessentials/csharpessentials-errors
Claude Code and agent skill by senrecep/csharpessentials
- community
Checking that the SKILL.md file is still in the repository.
Use when creating structured error values. Covers Error factory methods (Failure/Validation/NotFound/Conflict/Unauthorized/Forbidden/Unexpected), ErrorMetadata for contextual data, HTTP status mapping, and domain-specific static error class hierarchies.
Install
npx vskill@latest install senrecep/csharpessentials/csharpessentials-errorsSKILL.md
CSharpEssentials.Errors
Errors are values, not exceptions. Error is a readonly record struct with a code, description, type, and optional metadata.
Installation
Namespace
Creating Errors
Error Properties
Every factory has defaults for code and description (Error.NotFound() has the code NotFound). Two errors are equal when type, code, description and metadata entries are equal.
ErrorMetadata
Combining Errors
HTTP Status Mapping
Validation 400, Unauthorized 401, Forbidden 403, NotFound 404, Conflict 409. ToErrorType reverses 400, 401, 403, 404, 409 and 500 (Failure); any other status gives Unexpected.
Domain-Specific Error Hierarchies
Error is a readonly record struct, so it cannot be subclassed. Use static classes per aggregate:
Domain Exceptions
Best Practices
- Group errors in static classes per aggregate for IDE autocomplete + type-safe codes
- Use
error.Description; the field is namedDescription, notMessage ErrorMetadatauses.AddMetadata(); there is no.WithMetadata()- Prefer factory methods (parameterized) over static readonly fields when the message includes runtime data
Erroris a value type, safe to use as dictionary key, in switch expressions, etc.
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryChecking.well-known/agent-skills/csharpessentials-errors/SKILL.md
Popularity
- Repository stars
- 27
- Repository forks
- 1
- 7-day trend score
- 0
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/senrecep/csharpessentials/csharpessentials-errors)