{"record":{"id":"01564812a6bdf14f","repo":"diegosouzapw/OmniRoute","slug":"errbody-error-message-patch-api-quota-pools-015648","errorCode":null,"errorMessage":"errBody?.error?.message || `PATCH /api/quota/pools failed: HTTP ${editPatchRes.status}`","messagePattern":"errBody\\?\\.error\\?\\.message \\|\\| `PATCH /api/quota/pools failed: HTTP (.+?)`","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/app/(dashboard)/dashboard/costs/quota-share/components/PoolWizard.tsx","lineNumber":509,"sourceCode":"      } else {\n        // ── Edit mode: single PATCH (folds name, groupId, connectionIds, allocations, exclusive)\n        // + optional PUT for plan dimensions when user edited them.\n\n        // 1. PATCH /api/quota/pools/[id] — all editable fields in one call\n        const editPatchRes = await fetch(`/api/quota/pools/${editPool.id}`, {\n          method: \"PATCH\",\n          headers: { \"Content-Type\": \"application/json\" },\n          body: JSON.stringify({\n            name: effectivePoolName,\n            groupId: resolvedGroupId,\n            connectionIds,\n            allocations,\n            exclusive,\n          }),\n        });\n        if (!editPatchRes.ok) {\n          const errBody = await editPatchRes.json().catch(() => null);\n          throw new Error(\n            errBody?.error?.message || `PATCH /api/quota/pools failed: HTTP ${editPatchRes.status}`\n          );\n        }\n\n        // 2. PUT /api/quota/plans/[primaryConnectionId] — only when user actually edited dimensions\n        if (dimensionsEdited && editDimensions.length > 0) {\n          const planRes = await fetch(`/api/quota/plans/${primaryConnectionId}`, {\n            method: \"PUT\",\n            headers: { \"Content-Type\": \"application/json\" },\n            body: JSON.stringify({ dimensions: editDimensions }),\n          });\n          if (!planRes.ok) {\n            const errBody = await planRes.json().catch(() => null);\n            throw new Error(\n              errBody?.error?.message || `PUT /api/quota/plans failed: HTTP ${planRes.status}`\n            );\n          }\n        }","sourceCodeStart":491,"sourceCodeEnd":527,"githubUrl":"https://github.com/diegosouzapw/OmniRoute/blob/a179ffed5bb2e0b883b9ae7214ce8717b2a94c4d/src/app/(dashboard)/dashboard/costs/quota-share/components/PoolWizard.tsx#L491-L527","documentation":"Error \"errBody?.error?.message || `PATCH /api/quota/pools failed: HTTP ${editPatchRes.status}`\" thrown in diegosouzapw/OmniRoute.","triggerScenarios":"Thrown at src/app/(dashboard)/dashboard/costs/quota-share/components/PoolWizard.tsx:509 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"}