Standardize service errors with ProblemDetails envelope

This commit is contained in:
2026-02-07 01:23:54 +01:00
parent 79dc8f899f
commit f615ef3a4a
9 changed files with 63 additions and 33 deletions

View File

@@ -66,7 +66,7 @@ public static class StateEndpoints
{
if (reconciled)
await db.SaveChangesAsync();
return Results.BadRequest(new { error = "Results are locked until the admin enables them." });
return EndpointHelpers.BadRequestError("Results are locked until the admin enables them.");
}
player.CurrentPhase = next;
@@ -88,7 +88,7 @@ public static class StateEndpoints
var isAdmin = await EndpointHelpers.IsAdmin(ctx, db);
if (!isAdmin)
{
return Results.BadRequest(new { error = "Only admins can move backward." });
return EndpointHelpers.BadRequestError("Only admins can move backward.");
}
var appState = await db.AppState.FirstAsync();