{"record":{"id":"f85cf021bae2f68f","repo":"Hmbown/CodeWhale","slug":"http-res-status","errorCode":null,"errorMessage":"HTTP ${res.status}","messagePattern":"HTTP \\$\\{res\\.status\\}","errorType":"http","errorClass":"Error","httpStatus":null,"severity":"warning","filePath":"crates/tui/src/runtime_mobile.html","lineNumber":325,"sourceCode":"    }\n\n    function headers(extra = {}) {\n      const out = Object.assign({ \"Content-Type\": \"application/json\" }, extra);\n      if (token()) out.Authorization = \"Bearer \" + token();\n      return out;\n    }\n\n    async function api(path, options = {}) {\n      const res = await fetch(path, Object.assign({}, options, {\n        headers: headers(options.headers || {})\n      }));\n      if (!res.ok) {\n        let detail = await res.text();\n        try {\n          const parsed = JSON.parse(detail);\n          detail = parsed.error?.message || detail;\n        } catch (_) {}\n        throw new Error(detail || (\"HTTP \" + res.status));\n      }\n      if (res.status === 204) return null;\n      return res.json();\n    }\n\n    function escapeHtml(raw) {\n      return String(raw).replace(/[&<>\"']/g, (char) => ({\n        \"&\": \"&amp;\",\n        \"<\": \"&lt;\",\n        \">\": \"&gt;\",\n        \"\\\"\": \"&quot;\",\n        \"'\": \"&#039;\"\n      }[char]));\n    }\n\n    function eventPayload(data) {\n      return data && typeof data === \"object\" && \"payload\" in data ? data.payload : data;\n    }","sourceCodeStart":307,"sourceCodeEnd":343,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/0c42157ee52f9d55af2b506d71b46249910f77d3/crates/tui/src/runtime_mobile.html#L307-L343","documentation":"Startup warning that the theme named in settings could not be resolved/loaded by palette::resolve_theme_setting, so the System theme is used instead (the background_color override is still applied on top). Unknown theme names are normally normalized to \"system\" by Settings::load, so this fires when a value survives normalization but still fails resolution - typically a custom theme whose definition cannot be loaded or parsed.","triggerScenarios":"settings.theme references a custom/registered theme whose files are missing, unreadable, or fail palette parsing; a codewhale upgrade removed or renamed a built-in theme id; the theme-plus-background combination yields an invalid palette.","commonSituations":"Custom theme directory moved or deleted; broken dotfiles symlink after re-cloning; upgrading codewhale dropped an old theme id that settings still pin.","solutions":["Set theme back to a known value (\"system\") in settings to confirm the cause","Restore or fix the custom theme definition that the ({error}) names, then relaunch","After upgrading, check the available theme list for renamed/removed themes and update settings.theme accordingly"],"exampleFix":"# before (settings.toml)\ntheme = \"custom-ocean\"\n# after\ntheme = \"system\"","handlingStrategy":"validation","validationCode":"// Resolve the theme explicitly at startup and fall back on error.\nmatch palette::resolve_theme_setting(&settings.theme, background) {\n    Ok(resolved) => use_theme(resolved),\n    Err(err) => {\n        warn_user(format!(\"theme '{}' unavailable: {err}\", settings.theme));\n        use_system_theme_fallback();\n    }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Pin only built-in theme names in dotfiles","Keep custom theme files under version control so breakage is visible","Re-validate custom themes after every codewhale upgrade"],"tags":["theme","ui","palette","startup"],"backgroundTag":"invalid-theme-name","analyzedSha":"0c42157ee52f9d55af2b506d71b46249910f77d3","analyzedAt":"2026-08-20T21:50:45.477Z","schemaVersion":2},"datasetVersion":"2026-08-21T08:17:14.275Z"}