Agent: programmer (
programmer)
Confidence: 46%
Cost: $1.0851
Duration: 3m 2s
Task ID:59751491-c9f7-45e2-af84-7083e73847ba
修改摘要
改動內容
3 個檔案,+33 行 / -10 行
src/telegram/helpers.ts— 新增formatUserError()function(SPEC 提供的定義,因 Batch 5 尚未合併)src/documents/document-handler.ts— 5 處錯誤訊息統一:- Line 55:
❌ ${downloadResult.error}${fixHint}→formatUserError('cli-error', downloadResult.error) - Line 63:
❌ ${parseResult.error}${fixHint}→formatUserError('cli-error', parseResult.error) - Line 176:
❌ 檔案處理失敗: ${errMsg}→formatUserError('system-error', errMsg) - Line 214:
❌ 分析失敗: ${errMsg}→formatUserError('system-error', errMsg) - Line 250:
❌ AI 分析失敗: ${result.error}→formatUserError('cli-error', result.error) - Line 308: return
❌ 分析失敗: ${result.error}→formatUserError('cli-error', result.error)
- Line 55:
src/commands/remote.ts— 3 處錯誤訊息統一:/filescommand:Error: ${result.error}→formatUserError('cli-error', result.error)/runcommand:Error: ${result.error}${fixHint}→formatUserError('cli-error', result.error)/gitcommand:Error: ${result.error}→formatUserError('cli-error', result.error)
設計決策
fixHint不再單獨顯示 —formatUserError已提供標準化的 suggestion,避免重複建議- catch block 例外用
'system-error'類別(非預期錯誤),Result 失敗用'cli-error'類別(可預期的操作失敗) tsgo --noEmit通過,pre-commit hook 通過- Commit:
a818699
—HANDOFF—
TO: reviewer
INTENT: handoff
ARTIFACT_TYPE: code-change
SUMMARY: SPEC-39 supplement — unified 8 old-format error messages in document-handler.ts and remote.ts to use formatUserError()