{"record":{"id":"f66aab180240c6ca","repo":"diegosouzapw/OmniRoute","slug":"res-status","errorCode":null,"errorMessage":"${res.status}","messagePattern":"\\$\\{res\\.status\\}","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/app/(dashboard)/dashboard/analytics/CacheHealthTab.tsx","lineNumber":87,"sourceCode":"      <span className=\"text-2xl font-semibold text-text-main\">{value}</span>\n      {hint ? <span className=\"text-xs text-text-muted\">{hint}</span> : null}\n    </div>\n  );\n}\n\nexport default function CacheHealthTab() {\n  const t = useTranslations(\"analytics\") as Translator;\n  const [range, setRange] = useState<UtilizationTimeRange>(\"24h\");\n  const [data, setData] = useState<CacheHealthResponse | null>(null);\n  const [loading, setLoading] = useState(true);\n  const [error, setError] = useState<string | null>(null);\n\n  const load = useCallback(async (r: UtilizationTimeRange) => {\n    setLoading(true);\n    setError(null);\n    try {\n      const res = await fetch(`/api/usage/cache-health?range=${r}`);\n      if (!res.ok) throw new Error(String(res.status));\n      setData((await res.json()) as CacheHealthResponse);\n    } catch {\n      setError(\"load-failed\");\n      setData(null);\n    } finally {\n      setLoading(false);\n    }\n  }, []);\n\n  useEffect(() => {\n    void load(range);\n  }, [load, range]);\n\n  if (loading) return <Skeleton className=\"h-64 w-full\" />;\n\n  if (error || !data) {\n    return (\n      <Card>","sourceCodeStart":69,"sourceCodeEnd":105,"githubUrl":"https://github.com/diegosouzapw/OmniRoute/blob/a179ffed5bb2e0b883b9ae7214ce8717b2a94c4d/src/app/(dashboard)/dashboard/analytics/CacheHealthTab.tsx#L69-L105","documentation":"The cache-health dashboard effect got a non-OK status from the cache health API; the thrown Error carries the HTTP status code so the tab can show why utilization data is unavailable. Client-side only — the API itself returned its own error payload before this fired.","triggerScenarios":"Thrown at src/app/(dashboard)/dashboard/analytics/CacheHealthTab.tsx:87 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Confirm the cache-health endpoint responds 200 for the requested range","Check server logs for the failing analytics query","Retry transient 5xx before showing the error state"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"a179ffed5bb2e0b883b9ae7214ce8717b2a94c4d","analyzedAt":"2026-08-25T18:35:09.898Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}