mirror of
https://github.com/farion1231/cc-switch.git
synced 2026-07-31 19:22:15 +08:00
fix: surface backend error details in proxy toast messages
The takeover.failed i18n template lacked the {{detail}} placeholder
and three useProxyStatus onError callbacks omitted the detail variable,
so proxy start/stop/takeover failures all displayed a generic message
regardless of the underlying cause.
This commit is contained in:
@@ -57,6 +57,7 @@ export function useProxyStatus() {
|
||||
t("common.unknown", { defaultValue: "未知错误" });
|
||||
toast.error(
|
||||
t("proxy.server.startFailed", {
|
||||
detail,
|
||||
defaultValue: `启动代理服务失败: ${detail}`,
|
||||
}),
|
||||
);
|
||||
@@ -87,6 +88,7 @@ export function useProxyStatus() {
|
||||
t("common.unknown", { defaultValue: "未知错误" });
|
||||
toast.error(
|
||||
t("proxy.stopWithRestoreFailed", {
|
||||
detail,
|
||||
defaultValue: `停止失败: ${detail}`,
|
||||
}),
|
||||
);
|
||||
@@ -129,6 +131,7 @@ export function useProxyStatus() {
|
||||
t("common.unknown", { defaultValue: "未知错误" });
|
||||
toast.error(
|
||||
t("proxy.takeover.failed", {
|
||||
detail,
|
||||
defaultValue: `操作失败: ${detail}`,
|
||||
}),
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user