diegosouzapw/OmniRoute · error · Error

|| failedSaveMappings

Error message

${data.error?.message} || failedSaveMappings

What it means

handleSaveMappings' PUT to /api/cli-tools/antigravity-mitm/alias (tool id + modelMappings) returned non-OK. The thrown message prefers the server's error string or data.error.message; the localized 'failedSaveMappings' key is only the last-resort fallback.

Solutions

  1. Validate the mappings payload against the alias API schema
  2. Surface the server-provided error text to the user
  3. Check server logs for the failing PUT
Defensive patterns

Strategy: fallback

When it happens

Trigger: Thrown at src/app/(dashboard)/dashboard/cli-code/components/AntigravityToolCard.tsx:258 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/90f8d58ce412cea3. Report an issue: GitHub.

Appendix: source

Thrown at src/app/(dashboard)/dashboard/cli-code/components/AntigravityToolCard.tsx:258

      else delete entry.reasoningEffort;
      return { ...prev, [alias]: entry };
    });
  };

  const handleSaveMappings = async () => {
    setLoading(true);
    setMessage(null);

    try {
      const res = await fetch("/api/cli-tools/antigravity-mitm/alias", {
        method: "PUT",
        headers: { "Content-Type": "application/json" },
        body: JSON.stringify({ tool: tool.id, mappings: modelMappings }),
      });

      if (!res.ok) {
        const data = await res.json();
        throw new Error(
          (typeof data.error === "string" ? data.error : data.error?.message) ||
            t("failedSaveMappings")
        );
      }

      setMessage({ type: "success", text: t("mappingsSaved") });
    } catch (error) {
      setMessage({ type: "error", text: error.message });
    } finally {
      setLoading(false);
    }
  };

  const isRunning = status?.running;

  return (
    <Card padding="sm" className="overflow-hidden">
      <div className="flex items-center justify-between hover:cursor-pointer" onClick={onToggle}>

View on GitHub (pinned to a179ffed5b)