Remove NotFoundException; services return null on lookup miss
A missing record isn't exceptional — services now return null (logged at Info) instead of throwing, and endpoints map null to 404. Agent and import toolsets route not-found through their existing OrNotFound result pattern rather than a caught exception.
This commit is contained in:
@@ -61,7 +61,6 @@ app.UseExceptionHandler(handler => handler.Run(async context =>
|
||||
|
||||
var (status, title) = exception switch
|
||||
{
|
||||
NotFoundException => (StatusCodes.Status404NotFound, "Not found"),
|
||||
AgentNotConfiguredException => (StatusCodes.Status503ServiceUnavailable, "Agent unavailable"),
|
||||
ArgumentException or InvalidOperationException => (StatusCodes.Status400BadRequest, "Invalid request"),
|
||||
_ => (StatusCodes.Status500InternalServerError, "Unexpected error")
|
||||
|
||||
Reference in New Issue
Block a user