mirror of
https://github.com/farion1231/cc-switch.git
synced 2026-07-24 12:44:18 +08:00
fix: improve error message display in proxy panel (#3656)
This commit is contained in:
@@ -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: "切换接管状态失败",
|
||||
}),
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user