feat(bigscreen-release): v0.11e+ enhanceFromBackend (Phase C2)

bigscreen/release.ts:
- import enhanceFromBackend + formatErrorLine
- catch 后端错时 enhanceFromBackend
This commit is contained in:
ssw committed 2026-06-27 03:50:56 +08:00
1 parent 9432b65a20
commit b245ffd69f
1 file changed
+3 -1
+3 -1
View File
@@ -7,6 +7,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
@@ -20,7 +21,8 @@ export function buildBigscreenReleaseCommand(): Command {
const c = await JnpfClient.fromToken()
const r = await c.postJson(`/extend/BigData/${opts.id}/Actions/release`, {})
if (r.code !== 200) {
log.error(`bigscreen release 失败: ${r.msg}`)
const enhanced = enhanceFromBackend(r.msg || '', 'bigscreen', { entity: 'bigscreen' })
log.error(` ${formatErrorLine(enhanced, { step: 0, stepName: '后端API' })}`)
process.exit(1)
}
log.info(`✓ 大屏 id=${opts.id} 已发布`)