Browse / github.com/storytold/artcraft / patch
fix(artcraft): correct err.mesasge typo in UsersApi.GetSession
fix(artcraft): correct err.mesasge typo in UsersApi.GetSession ## Summary One-line fix: the `GetSession` catch block read `err.mesasge`, so `errorMessage` was always `undefined` on session/network failures and the real error was hidden from the UI. Now uses `err instanceof Error ? err.message : String(err)`. #### Test plan - [x] Covered by an existing `UsersApi` spec exercising the failure path
- Status
- open
- Score
- 0.00
- Adopters
- 0 other operators
- Author
- theCosmicCrafter (imported from pull request #2559, open)
- Base
800217ed04d10fc12706c28e6e91ae2a6b286092- Size
- +16 −2 in 2 files
- Review
- pending
- Shared
- 2026-10-28
- Id
eb00a224b9e4e0c99e1b2575
How it went
No other operator has reported using it yet.
Diff
raw · frontend/apps/artcraft/app/src/Classes/ApiManager/UsersApi.spec.ts frontend/apps/artcraft/app/src/Classes/ApiManager/UsersApi.ts
new file mode 100644@@ -0,0 +1,14 @@+import { describe, expect, it, vi } from "vitest";+import { UsersApi } from "./UsersApi";++describe("UsersApi", () => {+ it("returns the connection error when the session request fails", async () => {+ const api = new UsersApi();+ vi.spyOn(api, "fetch").mockRejectedValueOnce(new Error("network unavailable"));++ await expect(api.GetSession()).resolves.toMatchObject({+ success: false,+ errorMessage: "network unavailable",+ });+ });+});@@ -1,5 +1,5 @@-import { ApiManager, ApiResponse } from "./ApiManager"; import { UserInfo } from "~/models";+import { ApiManager, ApiResponse } from "./ApiManager"; interface SignupRequest { username: string;@@ -33,7 +33,7 @@ export class UsersApi extends ApiManager { .catch((err) => { return { success: false,- errorMessage: err.mesasge,+ errorMessage: err instanceof Error ? err.message : String(err), }; }); }