From ce538265cb67c712894956c282a65fdc54c9917f Mon Sep 17 00:00:00 2001 From: lzcndm Date: Wed, 3 Jun 2026 23:03:12 +0800 Subject: [PATCH] fix: improve error message display in proxy panel (#3656) --- src/components/proxy/ProxyPanel.tsx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/components/proxy/ProxyPanel.tsx b/src/components/proxy/ProxyPanel.tsx index a736c6b8c..c227a1230 100644 --- a/src/components/proxy/ProxyPanel.tsx +++ b/src/components/proxy/ProxyPanel.tsx @@ -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: "切换接管状态失败", }), );