aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/client/api/client.test.ts
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2025-12-31 19:39:47 +0900
committernsfisis <nsfisis@gmail.com>2025-12-31 19:39:47 +0900
commit73ee02825f57d971f6f660fc5277d4aa268702ff (patch)
tree2e7ed277375674982f87d156dc6012a683f5fe2d /src/client/api/client.test.ts
parentf211ebcfac0a21e264b67c1226509896a11ed5ca (diff)
downloadkioku-73ee02825f57d971f6f660fc5277d4aa268702ff.tar.gz
kioku-73ee02825f57d971f6f660fc5277d4aa268702ff.tar.zst
kioku-73ee02825f57d971f6f660fc5277d4aa268702ff.zip
fix(client): parse nested error object in API responses
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 <noreply@anthropic.com>
Diffstat (limited to 'src/client/api/client.test.ts')
-rw-r--r--src/client/api/client.test.ts6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/client/api/client.test.ts b/src/client/api/client.test.ts
index 16deb28..5489547 100644
--- a/src/client/api/client.test.ts
+++ b/src/client/api/client.test.ts
@@ -85,8 +85,10 @@ describe("ApiClient", () => {
{
status: 401,
body: {
- error: "Invalid username or password",
- code: "INVALID_CREDENTIALS",
+ error: {
+ message: "Invalid username or password",
+ code: "INVALID_CREDENTIALS",
+ },
},
},
]);