diegosouzapw/OmniRoute · error · Error

settings patch failed

Error message

settings patch failed

What it means

Bare sentinel from patchSettings(): a PATCH to /api/settings carrying routing fields (fallbackStrategy, stickyRoundRobinLimit, comboStrategy, ...) returned non-ok. The message is a fixed string with no detail — it only signals that the routing settings patch was rejected; the actual reason must be read from the response body or server logs.

Solutions

  1. Inspect the PATCH response body for the server's sanitized error
  2. Verify the strategy name and numeric limits match the server's accepted enum/range
  3. Retry after correcting the payload
Defensive patterns

Strategy: try-catch

When it happens

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

Appendix: source

Thrown at src/app/(dashboard)/dashboard/settings/components/RoutingStrategyCard.tsx:22

import { Card, Input, Toggle } from "@/shared/components";
import { useTranslations } from "next-intl";

type RoutingSettings = {
  fallbackStrategy?: string;
  stickyRoundRobinLimit?: number | string;
  comboStrategy?: string;
  comboStickyRoundRobinLimit?: number | string;
};

type Translate = ReturnType<typeof useTranslations>;

async function patchSettings(body: Record<string, unknown>) {
  const res = await fetch("/api/settings", {
    method: "PATCH",
    headers: { "Content-Type": "application/json" },
    body: JSON.stringify(body),
  });
  if (!res.ok) throw new Error("settings patch failed");
  return res.json();
}

async function patchComboDefaultsStrategy(strategy: string) {
  const res = await fetch("/api/settings/combo-defaults", {
    method: "PATCH",
    headers: { "Content-Type": "application/json" },
    body: JSON.stringify({ comboDefaults: { strategy } }),
  });
  if (!res.ok) throw new Error("combo-defaults patch failed");
}

function numericLimit(value: number | string | undefined, fallback: number): number {
  const n = typeof value === "number" ? value : parseInt(String(value), 10);
  return Number.isFinite(n) ? n : fallback;
}

/** Loads/persists the routing-strategy settings and tracks loading/busy state.

View on GitHub (pinned to a179ffed5b)