refactor(client): 统一 GitLens 错误归一化与 SubagentView 日志分级

- GitLens.tsx:六处 catch 里的 reason instanceof Error ?
  reason.message : String(reason)(refreshTarget/refresh/loadMoreLog/
  commit/checkout/runConfirmed)收敛为模块级 errorMessage(),
  两处模板字符串插值场景(historyLoadError/checkoutError 前缀)
  同样复用;归一化表达式与输出文本逐字不变。
- SubagentView.tsx:openSubagent/open session 失败的 console.warn
  改为 console.error,与同严重度失败路径对齐(Sidebar.tsx tab
  badge、TerminalView.tsx xterm open、service.ts urlTarget/plugin
  callback 均为 console.error);前缀与消息文本不变。tests/ 无任何
  钉 console.warn 的断言,已核实。
This commit is contained in:
Menghuan1918
2026-09-03 12:05:48 +08:00
parent 69cc8014a7
commit 4002f3cc5c
2 changed files with 14 additions and 8 deletions
+2 -2
View File
@@ -715,7 +715,7 @@ export function SubagentView(props: {
try {
sessions.openSubagent?.(address)
} catch (error) {
console.warn('[dsh-better-sidebar] openSubagent failed:', error)
console.error('[dsh-better-sidebar] openSubagent failed:', error)
}
}, [sessions, onOpenChild])
@@ -725,7 +725,7 @@ export function SubagentView(props: {
try {
sessions.open?.(rootId)
} catch (error) {
console.warn('[dsh-better-sidebar] open session failed:', error)
console.error('[dsh-better-sidebar] open session failed:', error)
}
}, [sessions, rootId])