{"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":55,"sourceCode":"  };\n  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      const recovery = tenantSessionRecovery.recoverIfNeeded(res.status, payload);\n      if (recovery) return recovery;\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      const recovery = tenantSessionRecovery.recoverIfNeeded(res.status, payload);\n      if (recovery) return recovery;\n      throw new Error(payload?.error ?? `Failed to request restart (${res.status})`);\n    }","sourceCodeStart":37,"sourceCodeEnd":73,"githubUrl":"https://github.com/paperclipai/paperclip/blob/3f1d897a7c018d76563a21c6e39c3c9b03933622/ui/src/api/health.ts#L37-L73","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":"3f1d897a7c018d76563a21c6e39c3c9b03933622","analyzedAt":"2026-08-18T22:49:45.177Z","contentChangedAt":"2026-08-18T22:49:45.177Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}