{"record":{"id":"8df3eb02a5fb9a16","repo":"diegosouzapw/OmniRoute","slug":"json-error-http-res-status","errorCode":null,"errorMessage":"${json.error} || HTTP ${res.status}","messagePattern":"(.+?) \\|\\| HTTP (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/app/(dashboard)/dashboard/combos/ComboControlCenterClient.tsx","lineNumber":71,"sourceCode":"  critical: \"border-red-500/20 bg-red-500/10 text-red-400\",\n  idle: \"border-blue-500/20 bg-blue-500/10 text-blue-400\",\n};\n\nfunction toArray<T>(value: unknown): T[] {\n  return Array.isArray(value) ? (value as T[]) : [];\n}\n\nasync function fetchJson<T>(url: string): Promise<T> {\n  const res = await fetch(url, { cache: \"no-store\" });\n  const json = await res.json().catch(() => ({}));\n  if (!res.ok) {\n    const message =\n      typeof json?.error === \"string\"\n        ? json.error\n        : typeof json?.error?.message === \"string\"\n          ? json.error.message\n          : `HTTP ${res.status}`;\n    throw new Error(message);\n  }\n  return json as T;\n}\n\nfunction fmtPercent(value: number | null | undefined): string {\n  if (typeof value !== \"number\" || !Number.isFinite(value)) return \"—\";\n  return `${Math.round(value)}%`;\n}\n\nfunction fmtMs(value: number | null | undefined): string {\n  if (typeof value !== \"number\" || !Number.isFinite(value) || value <= 0) return \"—\";\n  return `${Math.round(value)}ms`;\n}\n\nfunction fmtDate(value: string | null | undefined): string {\n  if (!value) return \"—\";\n  const date = new Date(value);\n  if (Number.isNaN(date.getTime())) return \"—\";","sourceCodeStart":53,"sourceCodeEnd":89,"githubUrl":"https://github.com/diegosouzapw/OmniRoute/blob/a179ffed5bb2e0b883b9ae7214ce8717b2a94c4d/src/app/(dashboard)/dashboard/combos/ComboControlCenterClient.tsx#L53-L89","documentation":"Error \"${json.error} || HTTP ${res.status}\" thrown in diegosouzapw/OmniRoute.","triggerScenarios":"Thrown at src/app/(dashboard)/dashboard/combos/ComboControlCenterClient.tsx:71 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"}