.claude/skills/ln-772-error-handler-setup/SKILL.md
Configures global exception handling middleware
npx skillsauth add cbbkrd-tech/jl-finishes ln-772-error-handler-setupInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Type: L3 Worker Category: 7XX Project Bootstrap Parent: ln-770-crosscutting-setup
Configures global error handling for .NET and Python backend applications.
| Aspect | Details | |--------|---------| | Input | Context Store from ln-770 | | Output | Exception handling middleware and custom exceptions | | Stacks | .NET (ASP.NET Core Middleware), Python (FastAPI exception handlers) |
Accept Context Store from coordinator.
Required Context:
STACK: .NET or PythonFRAMEWORK: ASP.NET Core or FastAPIPROJECT_ROOT: Project directory pathENVIRONMENT: Development or ProductionIdempotency Check:
GlobalExceptionMiddleware or UseExceptionHandler@app.exception_handler or exception_handlers.py{ "status": "skipped" }Use MCP tools to get up-to-date documentation.
For .NET:
MCP ref: "ASP.NET Core global exception handling middleware"
Context7: /dotnet/aspnetcore
For Python:
MCP ref: "FastAPI exception handlers custom exceptions"
Context7: /tiangolo/fastapi
Key Patterns to Research:
| Option | Description | |--------|-------------| | ProblemDetails (RFC 7807) (Recommended) | Standardized format, widely adopted | | Custom Format | Project-specific requirements |
| Environment | Stack Trace | Inner Exceptions | Request Details | |-------------|-------------|------------------|-----------------| | Development | ✓ Show | ✓ Show | ✓ Show | | Production | ✗ Hide | ✗ Hide | ✗ Hide |
Define standard error codes:
| Code | HTTP Status | Description |
|------|-------------|-------------|
| VALIDATION_ERROR | 400 | Invalid input data |
| UNAUTHORIZED | 401 | Authentication required |
| FORBIDDEN | 403 | Insufficient permissions |
| NOT_FOUND | 404 | Resource not found |
| CONFLICT | 409 | Resource state conflict |
| INTERNAL_ERROR | 500 | Unexpected server error |
| File | Purpose |
|------|---------|
| Middleware/GlobalExceptionMiddleware.cs | Exception handling middleware |
| Exceptions/AppException.cs | Base exception class |
| Exceptions/ValidationException.cs | Validation errors |
| Exceptions/NotFoundException.cs | Not found errors |
| Models/ErrorResponse.cs | Error response model |
Generation Process:
Registration Code:
app.UseMiddleware<GlobalExceptionMiddleware>();
| File | Purpose |
|------|---------|
| exceptions/app_exceptions.py | Custom exception classes |
| exceptions/handlers.py | FastAPI exception handlers |
| models/error_response.py | Pydantic error models |
Generation Process:
Registration Code:
app.add_exception_handler(AppException, app_exception_handler)
app.add_exception_handler(RequestValidationError, validation_exception_handler)
Validation Steps:
Syntax check:
dotnet build --no-restorepython -m py_compile exceptions/handlers.pyTest error handling:
Expected Error Response (ProblemDetails):
{
"type": "https://tools.ietf.org/html/rfc7231#section-6.5.1",
"title": "Validation Error",
"status": 400,
"detail": "Invalid input data",
"instance": "/api/users",
"errors": [
{ "field": "email", "message": "Invalid email format" }
],
"traceId": "abc-123-def-456"
}
{
"status": "success",
"files_created": [
"Middleware/GlobalExceptionMiddleware.cs",
"Exceptions/AppException.cs",
"Models/ErrorResponse.cs"
],
"packages_added": [],
"registration_code": "app.UseMiddleware<GlobalExceptionMiddleware>();",
"message": "Configured global exception handling"
}
GlobalExceptionMiddleware or exception_handlers.py exists, return status: "skipped"dotnet build or py_compile)Version: 2.0.0 Last Updated: 2026-01-10
testing
When the user wants to plan a content strategy, decide what content to create, or figure out what topics to cover. Also use when the user mentions "content strategy," "what should I write about," "content ideas," "blog strategy," "topic clusters," or "content planning." For writing individual pieces, see copywriting. For SEO-specific audits, see seo-audit.
development
When the user wants to create competitor comparison or alternative pages for SEO and sales enablement. Also use when the user mentions 'alternative page,' 'vs page,' 'competitor comparison,' 'comparison page,' '[Product] vs [Product],' '[Product] alternative,' or 'competitive landing pages.' Covers four formats: singular alternative, plural alternatives, you vs competitor, and competitor vs competitor. Emphasizes deep research, modular content architecture, and varied section types beyond feature tables.
development
Write B2B cold emails and follow-up sequences that get replies. Use when the user wants to write cold outreach emails, prospecting emails, cold email campaigns, sales development emails, or SDR emails. Covers subject lines, opening lines, body copy, CTAs, personalization, and multi-touch follow-up sequences.
development
When the user wants to reduce churn, build cancellation flows, set up save offers, recover failed payments, or implement retention strategies. Also use when the user mentions 'churn,' 'cancel flow,' 'offboarding,' 'save offer,' 'dunning,' 'failed payment recovery,' 'win-back,' 'retention,' 'exit survey,' 'pause subscription,' or 'involuntary churn.' This skill covers voluntary churn (cancel flows, save offers, exit surveys) and involuntary churn (dunning, payment recovery). For post-cancel win-back email sequences, see email-sequence. For in-app upgrade paywalls, see paywall-upgrade-cro.