{"record":{"id":"cf35ddd728b1ae24","repo":"thedotmack/claude-mem","slug":"failed-to-load-settings-res-status","errorCode":null,"errorMessage":"Failed to load settings (${res.status})","messagePattern":"Failed to load settings \\((.+?)\\)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/ui/viewer/hooks/useSettings.ts","lineNumber":16,"sourceCode":"import { useState, useEffect } from 'react';\nimport { Settings } from '../types';\nimport { DEFAULT_SETTINGS } from '../constants/settings';\nimport { API_ENDPOINTS } from '../constants/api';\nimport { TIMING } from '../constants/timing';\n\nexport function useSettings() {\n  const [settings, setSettings] = useState<Settings>(DEFAULT_SETTINGS);\n  const [isSaving, setIsSaving] = useState(false);\n  const [saveStatus, setSaveStatus] = useState('');\n\n  useEffect(() => {\n    fetch(API_ENDPOINTS.SETTINGS)\n      .then(async res => {\n        if (!res.ok) {\n          throw new Error(`Failed to load settings (${res.status})`);\n        }\n        return res.json();\n      })\n      .then(data => {\n        setSettings({ ...DEFAULT_SETTINGS, ...data });\n      })\n      .catch(error => {\n        console.error('Failed to load settings:', error);\n      });\n  }, []);\n\n  const submitSettings = async (newSettings: Settings) => {\n    const response = await fetch(API_ENDPOINTS.SETTINGS, {\n      method: 'POST',\n      headers: { 'Content-Type': 'application/json' },\n      body: JSON.stringify(newSettings)\n    });\n","sourceCodeStart":1,"sourceCodeEnd":34,"githubUrl":"https://github.com/thedotmack/claude-mem/blob/d768ba364302d12b76e69e4f021f0bb1d2d50ed6/src/ui/viewer/hooks/useSettings.ts#L1-L34","documentation":"Error \"Failed to load settings (${res.status})\" thrown in thedotmack/claude-mem.","triggerScenarios":"Fires in the viewer UI when GET of the settings endpoint returns a non-2xx status, typically because the worker is down, the port in settings.json is stale, or the settings file is unreadable server-side. Guard at src/ui/viewer/hooks/useSettings.ts:16 surfaces the HTTP status instead of silently showing defaults.","commonSituations":"See trigger scenarios.","solutions":["Ensure the worker is running and serving the settings endpoint; reload the viewer after the worker is up.","Check the HTTP status in the message: 5xx means worker-side failure (see worker logs), 4xx means a bad request or auth issue."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"d768ba364302d12b76e69e4f021f0bb1d2d50ed6","analyzedAt":"2026-08-12T23:52:55.241Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}