{"record":{"id":"0a0d77f1c0cdf831","repo":"diegosouzapw/OmniRoute","slug":"errbody-error-message-put-api-quota-plans-f","errorCode":null,"errorMessage":"errBody?.error?.message || `PUT /api/quota/plans failed: HTTP ${planRes.status}`","messagePattern":"errBody\\?\\.error\\?\\.message \\|\\| `PUT /api/quota/plans failed: HTTP (.+?)`","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/app/(dashboard)/dashboard/costs/quota-share/components/PoolWizard.tsx","lineNumber":473,"sourceCode":"        if (!createRes.ok) {\n          const errBody = await createRes.json().catch(() => null);\n          throw new Error(\n            errBody?.error?.message || `POST /api/quota/pools failed: HTTP ${createRes.status}`\n          );\n        }\n        const createData = (await createRes.json()) as { pool: { id: string } };\n        const newPoolId = createData.pool.id;\n\n        // 2. PUT /api/quota/plans/[primaryConnectionId] — only when user 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        }\n\n        // 3. PATCH /api/quota/pools/[id] — allocations + exclusive flag\n        const patchRes = await fetch(`/api/quota/pools/${newPoolId}`, {\n          method: \"PATCH\",\n          headers: { \"Content-Type\": \"application/json\" },\n          body: JSON.stringify({ allocations, exclusive }),\n        });\n        if (!patchRes.ok) {\n          const errBody = await patchRes.json().catch(() => null);\n          throw new Error(\n            errBody?.error?.message || `PATCH /api/quota/pools failed: HTTP ${patchRes.status}`\n          );\n        }\n      } else {","sourceCodeStart":455,"sourceCodeEnd":491,"githubUrl":"https://github.com/diegosouzapw/OmniRoute/blob/a179ffed5bb2e0b883b9ae7214ce8717b2a94c4d/src/app/(dashboard)/dashboard/costs/quota-share/components/PoolWizard.tsx#L455-L491","documentation":"Error \"errBody?.error?.message || `PUT /api/quota/plans failed: HTTP ${planRes.status}`\" thrown in diegosouzapw/OmniRoute.","triggerScenarios":"Thrown at src/app/(dashboard)/dashboard/costs/quota-share/components/PoolWizard.tsx:473 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"}