diegosouzapw/OmniRoute · error · Error
payload.error || t("clearSyncedPricingFailed")
Error message
payload.error || t("clearSyncedPricingFailed") What it means
Clear-synced-pricing failure: after an explicit confirm, the DELETE to /api/pricing/sync (which removes synced catalog entries) returned non-ok, and the thrown message is payload.error or the localized 'clearSyncedPricingFailed'. Synced pricing rows were not removed; manually edited provider pricing is unaffected either way.
Solutions
- Read the DELETE response error for the server-side reason
- Confirm no sync is currently in progress (concurrent mutation can reject)
- Retry the clear once the endpoint is idle
Defensive patterns
Strategy: try-catch
When it happens
Trigger: Thrown at src/app/(dashboard)/dashboard/settings/components/PricingTab.tsx:434 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/03f91e036d3f7c31.
Report an issue: GitHub.
Appendix: source
Thrown at src/app/(dashboard)/dashboard/settings/components/PricingTab.tsx:434
"error",
t("pricingSyncFailedWithReason", {
reason: error?.message || t("unknownError"),
})
);
} finally {
setSyncing(false);
}
}, [loadData, showStatus, t]);
const clearSyncedPricing = useCallback(async () => {
if (!confirm(t("clearSyncedPricingConfirm"))) return;
setSyncing(true);
try {
const response = await fetch("/api/pricing/sync", { method: "DELETE" });
if (!response.ok) {
const payload = (await response.json().catch(() => ({}))) as { error?: string };
throw new Error(payload.error || t("clearSyncedPricingFailed"));
}
await loadData();
showStatus("info", t("clearSyncedPricingSuccess"));
} catch (error: any) {
showStatus(
"error",
t("clearSyncedPricingFailedWithReason", {
reason: error?.message || t("unknownError"),
})
);
} finally {
setSyncing(false);
}
}, [loadData, showStatus, t]);
if (loading) {
return (View on GitHub (pinned to a179ffed5b)