diegosouzapw/OmniRoute · error · Error

data.error || t("regenerateFailed")

Error message

data.error || t("regenerateFailed")

What it means

Thrown when POST /api/settings/mitm with action 'regenerate-cert' fails. Certificate regeneration requires privileges and CA access — data.error reports sudo/certificate failures; regenerateFailed is the localized fallback.

Solutions

  1. Provide the sudo password if the CA is in a privileged location
  2. Check certificate store permissions on the server
  3. Retry after fixing; check MITM logs for the openssl failure
Defensive patterns

Strategy: try-catch

When it happens

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

Appendix: source

Thrown at src/app/(dashboard)/dashboard/settings/components/MitmProxyTab.tsx:159

        sudoPassword: sudoPassword || undefined,
      },
      status.running ? t("stoppedSuccess") : t("startedSuccess")
    );
  };

  const regenerateCertificate = async () => {
    if (!confirm(t("regenerateConfirm"))) return;

    setSaving(true);
    setFeedback(null);
    try {
      const response = await fetch("/api/settings/mitm", {
        method: "POST",
        headers: { "Content-Type": "application/json" },
        body: JSON.stringify({ action: "regenerate-cert" }),
      });
      const data = await response.json().catch(() => ({}));
      if (!response.ok) throw new Error(data.error || t("regenerateFailed"));
      setStatus(data);
      setFeedback({ type: "success", message: t("regenerateSuccess") });
    } catch (error) {
      setFeedback({
        type: "error",
        message: error instanceof Error ? error.message : t("regenerateFailed"),
      });
    } finally {
      setSaving(false);
    }
  };

  const statusTone = status.running
    ? "border-emerald-500/30 bg-emerald-500/10 text-emerald-600"
    : "border-border bg-sidebar text-text-muted";

  return (
    <Card className="p-6">

View on GitHub (pinned to a179ffed5b)