{"record":{"id":"bf3a8d47bc7cd604","repo":"paperclipai/paperclip","slug":"failed-to-load-health-res-status","errorCode":null,"errorMessage":"Failed to load health (${res.status})","messagePattern":"Failed to load health \\((.+?)\\)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"ui/src/api/health.ts","lineNumber":54,"sourceCode":"  serverInfo?: ServerInfoSnapshot;\n  devServer?: DevServerHealthStatus;\n  cloud?: CloudInstanceHealthStatus;\n  /**\n   * Settings surfaces hidden by the hosting operator (keys from the shared\n   * settings-visibility registry). Absent when nothing is hidden.\n   */\n  hiddenSettings?: string[];\n};\n\nexport const healthApi = {\n  get: async (): Promise<HealthStatus> => {\n    const res = await fetch(\"/api/health\", {\n      credentials: \"include\",\n      headers: { Accept: \"application/json\" },\n    });\n    if (!res.ok) {\n      const payload = await res.json().catch(() => null) as { error?: string } | null;\n      throw new Error(payload?.error ?? `Failed to load health (${res.status})`);\n    }\n    return res.json();\n  },\n  requestDevServerRestart: async (): Promise<void> => {\n    const res = await fetch(\"/api/health/dev-server/restart\", {\n      method: \"POST\",\n      credentials: \"include\",\n      headers: { Accept: \"application/json\" },\n    });\n    if (!res.ok) {\n      const payload = await res.json().catch(() => null) as { error?: string } | null;\n      throw new Error(payload?.error ?? `Failed to request restart (${res.status})`);\n    }\n  },\n};\n","sourceCodeStart":36,"sourceCodeEnd":70,"githubUrl":"https://github.com/paperclipai/paperclip/blob/a7e689b3c35347b529cb9f54c9b9a8575a3dcab6/ui/src/api/health.ts#L36-L70","documentation":"The UI health API got a non-OK response from GET /api/health. The thrown error prefers the server's JSON error payload; this fallback text (with HTTP status) is used when the body has no error field or is not JSON.","triggerScenarios":"Thrown at ui/src/api/health.ts:49 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Confirm the API server is running and reachable, then retry the health load.","Re-authenticate if the status indicates an auth failure."],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"a7e689b3c35347b529cb9f54c9b9a8575a3dcab6","analyzedAt":"2026-08-18T22:49:45.177Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}