diegosouzapw/OmniRoute · error · Error

Failed to save auto-disable config

Error message

Failed to save auto-disable config

What it means

Literal error thrown when PUT /api/settings/auto-disable-accounts returns non-OK while saving the auto-disable configuration. Means the draft failed server-side validation (thresholds, windows) or the settings write was rejected.

Solutions

  1. Check draft values are within valid ranges before saving
  2. Reload to resync the form with persisted config
  3. Check /api/settings/auto-disable-accounts logs for validation errors
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at src/app/(dashboard)/dashboard/settings/components/AutoDisableCard.tsx:65 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/801346e8014bd195. Report an issue: GitHub.

Appendix: source

Thrown at src/app/(dashboard)/dashboard/settings/components/AutoDisableCard.tsx:65

      .then((res) => res.json())
      .then((json) => {
        const next = normalizeForm(json);
        setData(next);
        setDraft(next);
        setLoading(false);
      })
      .catch(() => setLoading(false));
  }, []);

  const handleSave = async () => {
    setSaving(true);
    try {
      const res = await fetch("/api/settings/auto-disable-accounts", {
        method: "PUT",
        headers: { "Content-Type": "application/json" },
        body: JSON.stringify(draft),
      });
      if (!res.ok) throw new Error("Failed to save auto-disable config");
      const savedData = normalizeForm(await res.json());
      setData(savedData);
      setEditMode(false);
      notify.success(t("savedSuccessfully"));
    } catch (err) {
      notify.error(err instanceof Error ? err.message : "Error saving");
    } finally {
      setSaving(false);
    }
  };

  if (loading) return null;

  const current = editMode ? draft : data;
  const scopes = AUTO_DISABLE_BANNED_SCOPES;

  return (
    <Card className="p-0 overflow-hidden">

View on GitHub (pinned to a179ffed5b)