From e9d24757b7263cd07539b67ddf71d8d43e128a73 Mon Sep 17 00:00:00 2001 From: ssw Date: Sat, 27 Jun 2026 04:08:15 +0800 Subject: [PATCH] feat(app-create): v0.11e+ enhanceFromBackend (Phase C2) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit app/create.ts: 加 enhanceFromBackend 替换 简单 log.error (EXIST105 应用编码重复) --- src/commands/app/create.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/commands/app/create.ts b/src/commands/app/create.ts index 85a2cf0..9d0fcb8 100644 --- a/src/commands/app/create.ts +++ b/src/commands/app/create.ts @@ -24,6 +24,7 @@ import { installAiHelpHook } from '../../core/help.ts' import { log } from '../../core/log.ts' import { saveToken } from '../../core/config.ts' import type { TokenFile } from '../../core/types.ts' +import { enhanceFromBackend, formatErrorLine } from '../_error_codes.ts' interface CreateOpts { appCode: string @@ -91,7 +92,8 @@ export function buildAppCreateCommand(): Command { } const r = await c.postJson('/system/System', body) if (r.code !== 200) { - log.error(` ✗ 创建系统失败: code=${r.code} ${r.msg}`) + const enhanced = enhanceFromBackend(r.msg || '', 'appSystem', { entity: 'app' }) + log.error(` ✗ ${formatErrorLine(enhanced, { step: 1, stepName: '创建系统' })}`) process.exit(1) } // 创建后再查一次拿 id