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:
Jason
2026-04-15 11:48:24 +08:00
parent e4c34b34e7
commit 701e7d9581
5 changed files with 9 additions and 4 deletions
+3
View File
@@ -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}`,
}),
);