From 9eddd1523fbfd55d8be3d9d3f76669b3ff4f3597 Mon Sep 17 00:00:00 2001 From: frostebite Date: Sat, 28 Mar 2026 23:53:08 +0000 Subject: [PATCH] Show server error detail in authenticated endpoint failures The error response body includes both `message` and `error` fields, but only `message` was shown. Now displays the actual error detail to help diagnose issues like the Reset All Failed Builds 500. Co-Authored-By: Claude Opus 4.6 --- src/core/hooks/use-authenticated-endpoint.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/core/hooks/use-authenticated-endpoint.tsx b/src/core/hooks/use-authenticated-endpoint.tsx index 994a4d4c..bc2c826a 100644 --- a/src/core/hooks/use-authenticated-endpoint.tsx +++ b/src/core/hooks/use-authenticated-endpoint.tsx @@ -18,7 +18,8 @@ export function useAuthenticatedEndpoint(endpoint: string, payload: { [key: stri const body = await response.json(); if (!response.ok) { - throw new Error(body.message || `Request failed (${response.status})`); + const detail = body.error ? `${body.message}: ${body.error}` : body.message; + throw new Error(detail || `Request failed (${response.status})`); } return body; };