diegosouzapw/OmniRoute · error
[quota-pools] removeQuotaCombosForPool failed (non-fatal):
Error message
[quota-pools] removeQuotaCombosForPool failed (non-fatal):
What it means
After deleting a quota pool, removing its derived quota combos failed (dynamic import or execution error). Guarded as non-fatal: the pool deletion succeeded, but orphaned combo definitions referencing the deleted pool may persist until a later cleanup/sync removes them.
Solutions
- Re-run combo sync to purge orphaned combos
- Inspect the logged error for the import/execution cause
- Manually remove combos referencing the deleted pool if they disrupt routing
Defensive patterns
Strategy: try-catch
When it happens
Trigger: Thrown at src/lib/db/quotaPools.ts:51 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/7660f1f415517869.
Report an issue: GitHub.
Appendix: source
Thrown at src/lib/db/quotaPools.ts:51
return current;
}
async function syncQuotaCombosGuarded(poolId: string): Promise<void> {
try {
const { syncQuotaCombos } = await import("@/lib/quota/quotaCombos");
await syncQuotaCombos(poolId);
} catch (err) {
// Guard: combo-sync failure must never break pool CRUD callers.
console.warn("[quota-pools] syncQuotaCombos failed (non-fatal):", (err as Error)?.message);
}
}
async function removeQuotaCombosGuarded(poolId: string): Promise<void> {
try {
const { removeQuotaCombosForPool } = await import("@/lib/quota/quotaCombos");
await removeQuotaCombosForPool(poolId);
} catch (err) {
console.warn(
"[quota-pools] removeQuotaCombosForPool failed (non-fatal):",
(err as Error)?.message,
);
}
}
// ---------------------------------------------------------------------------
// Local type shapes (aligned with src/lib/quota/dimensions.ts — merged by F7)
// ---------------------------------------------------------------------------
type QuotaUnit = "percent" | "requests" | "tokens" | "usd";
type Policy = "hard" | "soft" | "burst";
export interface PoolAllocation {
apiKeyId: string;
weight: number;
capValue?: number;
capUnit?: QuotaUnit;View on GitHub (pinned to a179ffed5b)