diegosouzapw/OmniRoute · error · Error

Failed to load current settings

Error message

Failed to load current settings

What it means

Error "Failed to load current settings" thrown in diegosouzapw/OmniRoute.

Source

Thrown at src/app/(dashboard)/dashboard/settings/components/ModelAliasesUnified.tsx:114

      });
      if (!res.ok) throw new Error("Failed to remove exact alias");
      const data = await res.json();
      setCustomAliases(data.custom || {});
      showStatus("success", translateOrFallback(t, "saved", "Saved"));
    } catch (error) {
      console.error("Failed to remove exact alias:", error);
      showStatus("error", translateOrFallback(t, "errorOccurred", "An error occurred"));
    } finally {
      setSaving(false);
    }
  };

  const addWildcardAlias = async () => {
    if (!fromValue.trim() || !toValue.trim()) return;
    setSaving(true);
    try {
      const settingsRes = await fetch("/api/settings", { cache: "no-store" });
      if (!settingsRes.ok) throw new Error("Failed to load current settings");
      const settingsData = await settingsRes.json();
      const revision =
        typeof settingsData.settingsRevision === "number" ? settingsData.settingsRevision : 0;
      const currentWildcards = Array.isArray(settingsData.wildcardAliases)
        ? settingsData.wildcardAliases
        : wildcardAliases;
      const updated = [
        ...currentWildcards,
        { pattern: fromValue.trim(), target: toValue.trim() },
      ];
      const res = await fetch("/api/settings", {
        method: "PATCH",
        headers: { "Content-Type": "application/json" },
        body: JSON.stringify({ wildcardAliases: updated, expectedRevision: revision }),
      });
      if (res.status === 409) throw new Error("Settings conflict — refresh and retry");
      if (!res.ok) throw new Error("Failed to save wildcard alias");
      setWildcardAliases(updated);

View on GitHub (pinned to a179ffed5b)

When it happens

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