{"record":{"id":"1cd189ce80457086","repo":"diegosouzapw/OmniRoute","slug":"data-error-t-proxysubscription-savefailed","errorCode":null,"errorMessage":"data.error || t(\"proxySubscription.saveFailed\")","messagePattern":"data\\.error \\|\\| t\\(\"proxySubscription\\.saveFailed\"\\)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/app/(dashboard)/dashboard/settings/components/proxy/SubscriptionTab.tsx","lineNumber":176,"sourceCode":"        ruleProviders: form.mode === \"rule\" ? form.ruleProviders : null,\n        localCoreEndpoint: form.localCoreEndpoint.trim() || null,\n        updateIntervalMinutes: Number(form.updateIntervalMinutes) || 60,\n        enabled: form.enabled,\n      };\n      const res = editingId\n        ? await fetch(`/api/v1/management/proxy-subscriptions/${editingId}`, {\n            method: \"PATCH\",\n            headers: { \"Content-Type\": \"application/json\" },\n            body: JSON.stringify(payload),\n          })\n        : await fetch(\"/api/v1/management/proxy-subscriptions\", {\n            method: \"POST\",\n            headers: { \"Content-Type\": \"application/json\" },\n            body: JSON.stringify(payload),\n          });\n      if (!res.ok) {\n        const data = await res.json().catch(() => ({}));\n        throw new Error(data.error || t(\"proxySubscription.saveFailed\"));\n      }\n      resetForm();\n      await load();\n    } catch (e) {\n      setFormError(e instanceof Error ? e.message : String(e));\n    } finally {\n      setSaving(false);\n    }\n  };\n\n  const toggleEnabled = async (sub: SubscriptionRecord) => {\n    setBusyId(sub.id);\n    try {\n      const res = await fetch(`/api/v1/management/proxy-subscriptions/${sub.id}`, {\n        method: \"PATCH\",\n        headers: { \"Content-Type\": \"application/json\" },\n        body: JSON.stringify({ enabled: !sub.enabled }),\n      });","sourceCodeStart":158,"sourceCodeEnd":194,"githubUrl":"https://github.com/diegosouzapw/OmniRoute/blob/a179ffed5bb2e0b883b9ae7214ce8717b2a94c4d/src/app/(dashboard)/dashboard/settings/components/proxy/SubscriptionTab.tsx#L158-L194","documentation":"Subscription create/update failure: the POST (new) or PATCH (edit, /{editingId}) to /api/v1/management/proxy-subscriptions returned non-ok; the thrown message is data.error from the body or the localized 'saveFailed'. Client-side guards (name/url/ruleProviders) already passed, so this is a server-side rejection — validation, duplicate, or management-API error.","triggerScenarios":"Thrown at src/app/(dashboard)/dashboard/settings/components/proxy/SubscriptionTab.tsx:176 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Read data.error for the server's sanitized rejection reason","Fix duplicates or invalid URL/mode/provider values it names","Retry save; the list reloads only on success"],"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"}