Error handling for ASP.NET Core APIs — exception middleware, ProblemDetails,
94
90%
Does it follow best practices?
Impact
100%
1.13xAverage score across 5 eval scenarios
Passed
No known issues
{
"context": "Tests whether the agent adds UseStatusCodePages to handle non-exception HTTP errors (routing 404s, 405s) and returns structured ProblemDetails responses for them, with correct Content-Type and pipeline ordering.",
"type": "weighted_checklist",
"checklist": [
{
"name": "UseStatusCodePages present",
"description": "Program.cs calls app.UseStatusCodePages() or app.UseStatusCodePages(...) — the middleware is explicitly registered",
"max_score": 18
},
{
"name": "UseExceptionHandler present",
"description": "Program.cs also calls app.UseExceptionHandler() (the two middleware work together)",
"max_score": 10
},
{
"name": "Exception handler before routing",
"description": "app.UseExceptionHandler() appears before app.MapControllers() / app.UseRouting() in Program.cs",
"max_score": 10
},
{
"name": "UseStatusCodePages before routing",
"description": "app.UseStatusCodePages() appears before app.MapControllers() / app.UseRouting() in Program.cs",
"max_score": 10
},
{
"name": "pipeline_notes explains routing misses",
"description": "pipeline_notes.md explicitly mentions that routing 404s (requests to undefined URLs) are handled by UseStatusCodePages, not by the exception handler",
"max_score": 15
},
{
"name": "pipeline_notes explains middleware ordering",
"description": "pipeline_notes.md describes or references the order in which the error-handling middleware components are registered",
"max_score": 12
},
{
"name": "AddProblemDetails registered",
"description": "Program.cs calls builder.Services.AddProblemDetails() so ASP.NET Core can produce ProblemDetails for status code responses",
"max_score": 15
},
{
"name": "UseStatusCodePages with ProblemDetails format",
"description": "The UseStatusCodePages configuration (or AddProblemDetails setup) produces a structured response rather than plain text — either by using the default ProblemDetails integration or by explicitly configuring a JSON response body",
"max_score": 10
}
]
}evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
skills
aspnet-error-handling
verifiers