diegosouzapw/OmniRoute · error · Error

payload.error || t("pricingSyncFailed")

Error message

payload.error || t("pricingSyncFailed")

What it means

Pricing sync trigger failure: triggerSync() POSTs /api/pricing/sync and treats both a non-ok response AND success===false in a 200 body as failure, throwing payload.error or the localized 'pricingSyncFailed'. It means the upstream pricing catalog was not (fully) fetched/applied — e.g. upstream unreachable, sync already running, or a partial update aborted.

Solutions

  1. Check payload.error for the upstream reason (network, rate limit, parse failure)
  2. Retry the sync after the upstream source recovers
  3. Run clearSyncedPricing then re-sync if the catalog is in a partial state
Defensive patterns

Strategy: retry

When it happens

Trigger: Thrown at src/app/(dashboard)/dashboard/settings/components/PricingTab.tsx:409 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/76475758a0ad6abf. Report an issue: GitHub.

Appendix: source

Thrown at src/app/(dashboard)/dashboard/settings/components/PricingTab.tsx:409

    [loadData, showStatus, t]
  );

  const triggerSync = useCallback(async () => {
    setSyncing(true);
    try {
      const response = await fetch("/api/pricing/sync", {
        method: "POST",
        headers: { "Content-Type": "application/json" },
        body: JSON.stringify({}),
      });
      const payload = (await response.json().catch(() => ({}))) as {
        success?: boolean;
        modelCount?: number;
        error?: string;
      };

      if (!response.ok || payload.success === false) {
        throw new Error(payload.error || t("pricingSyncFailed"));
      }

      await loadData();
      showStatus("success", t("pricingSyncSuccess", { count: payload.modelCount || 0 }));
    } catch (error: any) {
      showStatus(
        "error",
        t("pricingSyncFailedWithReason", {
          reason: error?.message || t("unknownError"),
        })
      );
    } finally {
      setSyncing(false);
    }
  }, [loadData, showStatus, t]);

  const clearSyncedPricing = useCallback(async () => {
    if (!confirm(t("clearSyncedPricingConfirm"))) return;

View on GitHub (pinned to a179ffed5b)