{"record":{"id":"4138716c4083faa5","repo":"diegosouzapw/OmniRoute","slug":"failed-to-save-provider-tier-override-res-statu","errorCode":null,"errorMessage":"Failed to save provider tier override (${res.status})","messagePattern":"Failed to save provider tier override \\((.+?)\\)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/app/(dashboard)/dashboard/providers/[id]/components/modals/providerTierFieldApi.ts","lineNumber":47,"sourceCode":"  const config = (await res.json()) as TierConfig;\n  const match = config.providerOverrides?.find(\n    (o) => o.provider.toLowerCase() === provider.toLowerCase()\n  );\n  return normalizeTierValue(match?.tier);\n}\n\n/** Set (or clear, when `tier === \"\"`) the tier override for `provider`. */\nexport async function saveProviderTierOverride(\n  provider: string,\n  tier: ProviderTier | \"\"\n): Promise<void> {\n  const res = await fetch(\"/api/settings/tier-config\", {\n    method: \"PUT\",\n    headers: { \"Content-Type\": \"application/json\" },\n    body: JSON.stringify({ provider, tier: tier === \"\" ? null : tier }),\n  });\n  if (!res.ok) {\n    throw new Error(`Failed to save provider tier override (${res.status})`);\n  }\n}\n","sourceCodeStart":29,"sourceCodeEnd":50,"githubUrl":"https://github.com/diegosouzapw/OmniRoute/blob/a179ffed5bb2e0b883b9ae7214ce8717b2a94c4d/src/app/(dashboard)/dashboard/providers/[id]/components/modals/providerTierFieldApi.ts#L29-L50","documentation":"saveProviderTierOverride PUT /api/settings/tier-config returned a non-OK status, so the per-provider tier override could not be persisted. This is a dashboard client-side error wrapper carrying the HTTP status for the settings form to display.","triggerScenarios":"Thrown at src/app/(dashboard)/dashboard/providers/[id]/components/modals/providerTierFieldApi.ts:47 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Show the status to the user and keep the form in its previous state","Check auth/JWT expiry on 401 and redirect to login","Retry on 5xx; investigate the route for validation rejects on 400"],"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"}