From 7f212f6378e6277a092be058a5d60bd2b6ebb394 Mon Sep 17 00:00:00 2001 From: ssw Date: Sat, 27 Jun 2026 03:51:13 +0800 Subject: [PATCH] feat(portal-release): v0.11e+ enhanceFromBackend (Phase C2) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit portal/release.ts: - import enhanceFromBackend + formatErrorLine - catch 后端错时 enhanceFromBackend --- src/commands/portal/release.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/commands/portal/release.ts b/src/commands/portal/release.ts index 6c7c192..c1b1291 100644 --- a/src/commands/portal/release.ts +++ b/src/commands/portal/release.ts @@ -13,6 +13,7 @@ import { Command } from 'commander' import { JnpfClient } from '../../core/client.ts' import { installAiHelpHook } from '../../core/help.ts' import { log } from '../../core/log.ts' +import { enhanceFromBackend, formatErrorLine } from '../_error_codes.ts' interface ReleaseOpts { id: string @@ -39,7 +40,8 @@ export function buildPortalReleaseCommand(): Command { } const r = await c.putJson(`/visualdev/Portal/Actions/release/${opts.id}`, body) if (r.code !== 200) { - log.error(`portal release 失败 (code=${r.code}): ${r.msg}`) + const enhanced = enhanceFromBackend(r.msg || '', 'portal', { entity: 'portal' }) + log.error(` ${formatErrorLine(enhanced, { step: 0, stepName: '后端API' })}`) process.exit(1) } log.info(`✓ 门户 id=${opts.id} 已发布 (pc=${pc} app=${app})`)