ln-772-error-handler-setup — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited ln-772-error-handler-setup (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
Type: L3 Worker Category: 7XX Project Bootstrap
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/aspnetcoreFor Python:
MCP ref: "FastAPI exception handlers custom exceptions"
Context7: /tiangolo/fastapiKey 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:
dotnet build --no-restorepython -m py_compile exceptions/handlers.pyExpected 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
~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.