diegosouzapw/OmniRoute · error · Error
Settings API returned
Error message
Settings API returned ${response.status} What it means
Load sentinel for the request-limits tab: the initial GET to /api/settings (request body limit section) returned a non-ok status, and the thrown 'Settings API returned <status>' message surfaces that raw code. The tab falls back to DEFAULT_REQUEST_BODY_LIMIT_MB, so the input shows the default rather than the persisted MB limit.
Solutions
- Classify by status: 401/403 session expired (re-login), 5xx settings read failure (server logs)
- Reload the tab to re-fetch once the endpoint is healthy
- Do not save while the value shown is the unverified default — reload first
Defensive patterns
Strategy: try-catch
When it happens
Trigger: Thrown at src/app/(dashboard)/dashboard/settings/components/RequestLimitsTab.tsx:38 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/2bceb1f06bbd4aea.
Report an issue: GitHub.
Appendix: source
Thrown at src/app/(dashboard)/dashboard/settings/components/RequestLimitsTab.tsx:38
return typeof value === "number" && Number.isFinite(value)
? String(value)
: String(DEFAULT_REQUEST_BODY_LIMIT_MB);
}
export default function RequestLimitsTab() {
const t = useTranslations("settings");
const [value, setValue] = useState(String(DEFAULT_REQUEST_BODY_LIMIT_MB));
const [savedValue, setSavedValue] = useState(String(DEFAULT_REQUEST_BODY_LIMIT_MB));
const [loading, setLoading] = useState(true);
const [saving, setSaving] = useState(false);
const [message, setMessage] = useState<Message | null>(null);
useEffect(() => {
let active = true;
fetch("/api/settings")
.then((response) => {
if (!response.ok) throw new Error(`Settings API returned ${response.status}`);
return response.json() as Promise<SettingsResponse>;
})
.then((settings) => {
if (!active) return;
const nextValue = normalizeInputValue(settings.maxBodySizeMb);
setValue(nextValue);
setSavedValue(nextValue);
})
.catch((error) => {
console.error("Failed to load request limit settings:", error);
if (active) {
setMessage({ type: "error", text: t("requestBodyLimitLoadFailed") });
}
})
.finally(() => {
if (active) setLoading(false);
});
View on GitHub (pinned to a179ffed5b)