diegosouzapw/OmniRoute · error · Error

t("tokensDisconnectServerFailed")

Error message

t("tokensDisconnectServerFailed")

What it means

Localized sentinel thrown when disconnecting a gamification server fails: the DELETE to /api/gamification/servers?id=<serverId> returned non-ok. The server link persists; the fixed 'tokensDisconnectServerFailed' message replaces the raw status, so the rejection reason must be read from the response body.

Solutions

  1. Read the DELETE response body for the sanitized error
  2. Verify the server record still exists (404 = already disconnected)
  3. Retry after refreshing the server list
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at src/app/(dashboard)/dashboard/tokens/page.tsx:260 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/83b15cbd7559fb90. Report an issue: GitHub.

Appendix: source

Thrown at src/app/(dashboard)/dashboard/tokens/page.tsx:260

        await fetchData();
      } else {
        const data = await res.json().catch(() => null);
        setServerError(data?.error || t("tokensConnectServerFailed"));
      }
    } catch (error) {
      setServerError(error instanceof Error ? error.message : t("tokensConnectServerFailed"));
    } finally {
      setServerLoading(false);
    }
  };

  const handleDisconnectServer = async (serverId: string) => {
    setServerError("");
    try {
      const response = await fetch(`/api/gamification/servers?id=${serverId}`, {
        method: "DELETE",
      });
      if (!response.ok) throw new Error(t("tokensDisconnectServerFailed"));
      await fetchData();
    } catch (error) {
      setServerError(error instanceof Error ? error.message : t("tokensDisconnectServerFailed"));
    }
  };

  return (
    <div className="flex flex-col gap-6">
      {/* Balance */}
      <Card>
        <div className="flex items-center justify-between">
          <div>
            <p className="text-sm text-text-muted">{t("tokensTokenBalance")}</p>
            <p className="text-4xl font-bold mt-1">{balance.toLocaleString(locale)}</p>
          </div>
          <div className="text-6xl opacity-20">🪙</div>
        </div>
      </Card>

View on GitHub (pinned to a179ffed5b)