fix: improve error message display in proxy panel (#3656)

This commit is contained in:
lzcndm
2026-06-03 23:03:12 +08:00
committed by GitHub
parent e458e77e30
commit ce538265cb
+5
View File
@@ -29,6 +29,7 @@ import {
import type { ProxyStatus } from "@/types/proxy";
import { useTranslation } from "react-i18next";
import { AnimatePresence, motion } from "framer-motion";
import { extractErrorMessage } from "@/utils/errorUtils";
interface ProxyPanelProps {
enableLocalProxy: boolean;
@@ -88,8 +89,12 @@ export function ProxyPanel({
{ closeButton: true },
);
} catch (error) {
const detail =
extractErrorMessage(error) ||
t("common.unknown", { defaultValue: "未知错误" });
toast.error(
t("proxy.takeover.failed", {
detail,
defaultValue: "切换接管状态失败",
}),
);