diegosouzapw/OmniRoute · error · Error
errBody?.error?.message || `POST /api/quota/pools failed…
Error message
errBody?.error?.message || `POST /api/quota/pools failed: HTTP ${createRes.status}` What it means
PoolWizard create-mode step 1: the POST to /api/quota/pools (primary connection, connectionIds, name, groupId) returned non-OK; the thrown message prefers errBody.error.message over the 'POST /api/quota/pools failed: HTTP <status>' fallback. The wizard aborts before the optional plan PUT and member PATCH can run.
Solutions
- Validate connectionIds/name/groupId against the pools API contract
- Check quota constraints on the server for the primary connection
- Surface the server error message to the user
Defensive patterns
Strategy: fallback
When it happens
Trigger: Thrown at src/app/(dashboard)/dashboard/costs/quota-share/components/PoolWizard.tsx:457 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/fc0e0b327a260a39.
Report an issue: GitHub.
Appendix: source
Thrown at src/app/(dashboard)/dashboard/costs/quota-share/components/PoolWizard.tsx:457
try {
if (!editPool) {
// ── Create mode: POST → optional PUT → PATCH ──────────────────────
// 1. POST /api/quota/pools → get new pool id
const createRes = await fetch("/api/quota/pools", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
connectionId: primaryConnectionId,
connectionIds,
name: effectivePoolName,
allocations: [],
groupId: resolvedGroupId,
}),
});
if (!createRes.ok) {
const errBody = await createRes.json().catch(() => null);
throw new Error(
errBody?.error?.message || `POST /api/quota/pools failed: HTTP ${createRes.status}`
);
}
const createData = (await createRes.json()) as { pool: { id: string } };
const newPoolId = createData.pool.id;
// 2. PUT /api/quota/plans/[primaryConnectionId] — only when user 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)