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) }