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 replaces Console.WriteLine and string-interpolated log calls with structured ILogger calls using message templates and named parameters, uses correct log severity levels for different exception types, and passes the exception object to the logger.",
"type": "weighted_checklist",
"checklist": [
{
"name": "No Console.WriteLine",
"description": "GlobalExceptionHandler.cs does NOT contain any Console.WriteLine (or Console.Write) calls",
"max_score": 14
},
{
"name": "No string interpolation in LogError",
"description": "No _logger.LogError (or LogWarning/LogInformation) call uses a $\"...\" interpolated string as the message argument",
"max_score": 14
},
{
"name": "Named placeholders in log messages",
"description": "At least one logger call uses named placeholder syntax (e.g. _logger.LogError(ex, \"... {Method} {Path}\", method, path)) rather than a concatenated or interpolated string",
"max_score": 12
},
{
"name": "Exception passed to logger",
"description": "The LogError call for unhandled exceptions passes the exception object as the first argument (e.g. _logger.LogError(exception, \"message\", ...)) so stack traces are captured as structured data",
"max_score": 12
},
{
"name": "LogWarning for known API exceptions",
"description": "ApiException (known/domain errors) are logged at Warning level (_logger.LogWarning), not Error level",
"max_score": 12
},
{
"name": "LogError for unhandled exceptions",
"description": "Unknown/unexpected exceptions are logged at Error level (_logger.LogError)",
"max_score": 10
},
{
"name": "Request path included in log",
"description": "At least one log call includes the HTTP request path as a named structured parameter (e.g. {Path})",
"max_score": 10
},
{
"name": "Request method included in log",
"description": "At least one log call includes the HTTP method as a named structured parameter (e.g. {Method})",
"max_score": 8
},
{
"name": "compliance_report identifies Console.WriteLine issue",
"description": "compliance_report.md contains a section describing the Console.WriteLine usage as a problem and explains why ILogger should be used instead",
"max_score": 8
}
]
}evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
skills
aspnet-error-handling
verifiers