From 09d75b66d05b03dff956de7b3af36188e1778446 Mon Sep 17 00:00:00 2001 From: ssw Date: Sat, 27 Jun 2026 03:22:12 +0800 Subject: [PATCH] =?UTF-8?q?feat(bigscreen-update):=20v0.11e+=20Phase=20C2?= =?UTF-8?q?=20=E9=94=99=E8=AF=AF=E5=8F=8D=E9=A6=88=E7=BB=9F=E4=B8=80?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit bigscreen/update.ts: catch 后端错误时调 enhanceFromBackend (v0.11e+ A1 复用) 输出格式统一: '[step 1 后端API] field: CODE - message (suggestion)' 继续 Phase C2 统一化其他 create/update 文件 --- src/commands/bigscreen/update.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/commands/bigscreen/update.ts b/src/commands/bigscreen/update.ts index d654e3d..3d4d1c0 100644 --- a/src/commands/bigscreen/update.ts +++ b/src/commands/bigscreen/update.ts @@ -10,6 +10,7 @@ import { JnpfClient } from '../../core/client.ts' import { installAiHelpHook } from '../../core/help.ts' import { log, printJson } from '../../core/log.ts' import { initWebapi, loadVisualData } from '../../webapi/visualdata.ts' +import { enhanceFromBackend, formatErrorLine } from '../_error_codes.ts' interface Opts { id: string @@ -49,7 +50,8 @@ export function buildBigscreenUpdateCommand(): Command { loadVisualData.updateVisualData?.(opts.id, body) || loadVisualData.update?.(opts.id, body) )) as { code?: number; msg?: string; data?: unknown } if (r.code !== 200 && r.code !== undefined) { - log.error(`bigscreen update 失败 (code=${r.code}): ${r.msg}`) + const enhanced = enhanceFromBackend(r.msg || '', 'bigscreen', { entity: 'bigscreen' }) + log.error(` ${formatErrorLine(enhanced, { step: 1, stepName: '后端API' })}`) if (opts.json) printJson(r) process.exit(1) }