From 73ee02825f57d971f6f660fc5277d4aa268702ff Mon Sep 17 00:00:00 2001 From: nsfisis Date: Wed, 31 Dec 2025 19:39:47 +0900 Subject: fix(client): parse nested error object in API responses MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Server returns `{ error: { message, code } }` but client expected `{ error: string, code }`, causing "[object Object]" to display on login failure. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- src/client/api/client.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/client/api/client.ts') diff --git a/src/client/api/client.ts b/src/client/api/client.ts index 36a7431..7741942 100644 --- a/src/client/api/client.ts +++ b/src/client/api/client.ts @@ -66,9 +66,10 @@ export class ApiClient { if (!response.ok) { const errorBody = (await response.json().catch(() => ({}))) as ApiError; throw new ApiClientError( - errorBody.error || `Request failed with status ${response.status}`, + errorBody.error?.message || + `Request failed with status ${response.status}`, response.status, - errorBody.code, + errorBody.error?.code, ); } -- cgit v1.2.3-70-g09d2