diegosouzapw/OmniRoute · error · Error

json?.error?.message || json?.error || `HTTP

Error message

json?.error?.message || json?.error || `HTTP ${response.status}`

What it means

Section-save guard in ResilienceTab: savePatch() PATCHes a partial resilience payload (providerBreaker, cooldowns, etc.) and on non-ok throws the most specific available reason — json.error.message, then json.error, then the 'HTTP <status>' sentinel. It means that one section's patch was rejected (typically Zod validation of a resilience field) and was not persisted.

Solutions

  1. Prefer json.error.message when present — it names the invalid resilience field
  2. Correct the edited field (e.g. thresholds, reset windows) and re-save the section
  3. Check server logs if only the bare HTTP status is available
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at src/app/(dashboard)/dashboard/settings/components/ResilienceTab.tsx:1049 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/b8c41fd5e95fed40. Report an issue: GitHub.

Appendix: source

Thrown at src/app/(dashboard)/dashboard/settings/components/ResilienceTab.tsx:1049

    };

    void load();
    return () => {
      mounted = false;
    };
  }, [notify, tx]);

  const savePatch = async (section: string, payload: Record<string, unknown>) => {
    setSavingSection(section);
    try {
      const response = await fetch("/api/resilience", {
        method: "PATCH",
        headers: { "Content-Type": "application/json" },
        body: JSON.stringify(payload),
      });
      const json = await response.json();
      if (!response.ok) {
        throw new Error(json?.error?.message || json?.error || `HTTP ${response.status}`);
      }
      setData(toResilienceResponse(json));
      notify.success(tx("savedSuccessfully", "Resilience settings updated."));
    } catch (error) {
      notify.error(
        error instanceof Error
          ? error.message
          : tx("saveFailed", "Failed to save resilience settings")
      );
      throw error;
    } finally {
      setSavingSection(null);
    }
  };

  if (loading && !data) {
    return (
      <Card className="p-6">

View on GitHub (pinned to a179ffed5b)