{"record":{"id":"3faf4ba0299a49f7","repo":"diegosouzapw/OmniRoute","slug":"http-res-status-3faf4b","errorCode":null,"errorMessage":"HTTP ${res.status}","messagePattern":"HTTP \\$\\{res\\.status\\}","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/app/(dashboard)/dashboard/providers/services/components/ServiceLifecycleButtons.tsx","lineNumber":38,"sourceCode":"  const running = data?.state === \"running\";\n  const starting = data?.state === \"starting\";\n  const notInstalled = !data?.installedVersion;\n  const busy = pending !== null || starting;\n\n  async function action(verb: Action) {\n    setPending(verb);\n    setError(null);\n    try {\n      const res = await fetch(`/api/services/${name}/${verb}`, {\n        method: \"POST\",\n        headers: { \"Content-Type\": \"application/json\" },\n        body: JSON.stringify({}),\n      });\n      if (!res.ok) {\n        const payload = (await res.json().catch(() => null)) as {\n          error?: { message?: string };\n        } | null;\n        throw new Error(payload?.error?.message || `HTTP ${res.status}`);\n      }\n      mutate();\n    } catch (err) {\n      setError(err instanceof Error ? err.message : String(err));\n    } finally {\n      setPending(null);\n    }\n  }\n\n  if (notInstalled) {\n    return <LifecycleButtonGroup error={error} />;\n  }\n\n  return (\n    <div className=\"space-y-2\">\n      <div className=\"flex flex-wrap gap-2\">\n        <Button size=\"sm\" disabled={busy || running} onClick={() => action(\"start\")}>\n          {pending === \"start\" ? t(\"starting\") : t(\"start\")}","sourceCodeStart":20,"sourceCodeEnd":56,"githubUrl":"https://github.com/diegosouzapw/OmniRoute/blob/a179ffed5bb2e0b883b9ae7214ce8717b2a94c4d/src/app/(dashboard)/dashboard/providers/services/components/ServiceLifecycleButtons.tsx#L20-L56","documentation":"Error \"HTTP ${res.status}\" thrown in diegosouzapw/OmniRoute.","triggerScenarios":"Thrown at src/app/(dashboard)/dashboard/providers/services/components/ServiceLifecycleButtons.tsx:38 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"}