{"record":{"id":"ea1b58c053b65ed0","repo":"diegosouzapw/OmniRoute","slug":"failed-to-load-current-settings","errorCode":null,"errorMessage":"Failed to load current settings","messagePattern":"Failed to load current settings","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/app/(dashboard)/dashboard/settings/components/ModelAliasesUnified.tsx","lineNumber":114,"sourceCode":"      });\n      if (!res.ok) throw new Error(\"Failed to remove exact alias\");\n      const data = await res.json();\n      setCustomAliases(data.custom || {});\n      showStatus(\"success\", translateOrFallback(t, \"saved\", \"Saved\"));\n    } catch (error) {\n      console.error(\"Failed to remove exact alias:\", error);\n      showStatus(\"error\", translateOrFallback(t, \"errorOccurred\", \"An error occurred\"));\n    } finally {\n      setSaving(false);\n    }\n  };\n\n  const addWildcardAlias = async () => {\n    if (!fromValue.trim() || !toValue.trim()) return;\n    setSaving(true);\n    try {\n      const settingsRes = await fetch(\"/api/settings\", { cache: \"no-store\" });\n      if (!settingsRes.ok) throw new Error(\"Failed to load current settings\");\n      const settingsData = await settingsRes.json();\n      const revision =\n        typeof settingsData.settingsRevision === \"number\" ? settingsData.settingsRevision : 0;\n      const currentWildcards = Array.isArray(settingsData.wildcardAliases)\n        ? settingsData.wildcardAliases\n        : wildcardAliases;\n      const updated = [\n        ...currentWildcards,\n        { pattern: fromValue.trim(), target: toValue.trim() },\n      ];\n      const res = await fetch(\"/api/settings\", {\n        method: \"PATCH\",\n        headers: { \"Content-Type\": \"application/json\" },\n        body: JSON.stringify({ wildcardAliases: updated, expectedRevision: revision }),\n      });\n      if (res.status === 409) throw new Error(\"Settings conflict — refresh and retry\");\n      if (!res.ok) throw new Error(\"Failed to save wildcard alias\");\n      setWildcardAliases(updated);","sourceCodeStart":96,"sourceCodeEnd":132,"githubUrl":"https://github.com/diegosouzapw/OmniRoute/blob/a179ffed5bb2e0b883b9ae7214ce8717b2a94c4d/src/app/(dashboard)/dashboard/settings/components/ModelAliasesUnified.tsx#L96-L132","documentation":"Error \"Failed to load current settings\" thrown in diegosouzapw/OmniRoute.","triggerScenarios":"Thrown at src/app/(dashboard)/dashboard/settings/components/ModelAliasesUnified.tsx:114 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"a179ffed5bb2e0b883b9ae7214ce8717b2a94c4d","analyzedAt":"2026-08-25T18:35:09.898Z","schemaVersion":2},"datasetVersion":"2026-08-25T21:54:21.419Z"}