diegosouzapw/OmniRoute · error · Error
errBody?.error?.message || `PATCH /api/quota/pools failed…
Error message
errBody?.error?.message || `PATCH /api/quota/pools failed: HTTP ${editPatchRes.status}` What it means
PoolWizard edit-mode: the single PATCH to /api/quota/pools/<id> folding name, groupId, connectionIds, allocations and exclusivity returned non-OK; message prefers errBody.error.message over the 'PATCH /api/quota/pools failed: HTTP <status>' fallback.
Solutions
- Validate the full editable-fields payload before PATCH
- Surface the server error message
- Check server logs for the failing PATCH
Defensive patterns
Strategy: fallback
When it happens
Trigger: Thrown at src/app/(dashboard)/dashboard/costs/quota-share/components/PoolWizard.tsx:509 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of diegosouzapw/OmniRoute@a179ffed5b (2026-08-25).
Data as JSON: /api/errors/01564812a6bdf14f.
Report an issue: GitHub.
Appendix: source
Thrown at src/app/(dashboard)/dashboard/costs/quota-share/components/PoolWizard.tsx:509
} else {
// ── Edit mode: single PATCH (folds name, groupId, connectionIds, allocations, exclusive)
// + optional PUT for plan dimensions when user edited them.
// 1. PATCH /api/quota/pools/[id] — all editable fields in one call
const editPatchRes = await fetch(`/api/quota/pools/${editPool.id}`, {
method: "PATCH",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
name: effectivePoolName,
groupId: resolvedGroupId,
connectionIds,
allocations,
exclusive,
}),
});
if (!editPatchRes.ok) {
const errBody = await editPatchRes.json().catch(() => null);
throw new Error(
errBody?.error?.message || `PATCH /api/quota/pools failed: HTTP ${editPatchRes.status}`
);
}
// 2. PUT /api/quota/plans/[primaryConnectionId] — only when user actually edited dimensions
if (dimensionsEdited && editDimensions.length > 0) {
const planRes = await fetch(`/api/quota/plans/${primaryConnectionId}`, {
method: "PUT",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ dimensions: editDimensions }),
});
if (!planRes.ok) {
const errBody = await planRes.json().catch(() => null);
throw new Error(
errBody?.error?.message || `PUT /api/quota/plans failed: HTTP ${planRes.status}`
);
}
}View on GitHub (pinned to a179ffed5b)