diegosouzapw/OmniRoute · error · Error

errData.error || `HTTP ${res.status}`

Error message

errData.error || `HTTP ${res.status}`

What it means

Error "errData.error || `HTTP ${res.status}`" thrown in diegosouzapw/OmniRoute.

Source

Thrown at src/app/(dashboard)/dashboard/providers/[id]/components/ProviderInterceptionSection.tsx:47

}

type Translate = (key: string, values?: Record<string, string>) => string;

const DEFAULT_TOGGLES: InterceptionToggles = { interceptSearch: false, interceptFetch: false };

async function fetchInterceptionToggles(providerId: string): Promise<InterceptionToggles> {
  const res = await fetch(`/api/providers/${providerId}/interception-rules`);
  const data = await res.json();
  return {
    interceptSearch: data?.interceptSearch === true,
    interceptFetch: data?.interceptFetch === true,
  };
}

async function throwOnErrorResponse(res: Response): Promise<void> {
  if (res.ok) return;
  const errData = await res.json().catch(() => ({}));
  throw new Error(errData.error || `HTTP ${res.status}`);
}

async function putInterceptionToggles(
  providerId: string,
  toggles: InterceptionToggles
): Promise<void> {
  const res = await fetch(`/api/providers/${providerId}/interception-rules`, {
    method: "PUT",
    headers: { "Content-Type": "application/json" },
    body: JSON.stringify(toggles),
  });
  await throwOnErrorResponse(res);
}

function errorMessage(err: unknown): string {
  return err instanceof Error ? err.message : String(err);
}

View on GitHub (pinned to a179ffed5b)

When it happens

Trigger: Thrown at src/app/(dashboard)/dashboard/providers/[id]/components/ProviderInterceptionSection.tsx:47 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/200aa90d9357a6b8. Report an issue: GitHub.