From fdcb377fb5d7b151cc894f9719fd937a925ddf1a Mon Sep 17 00:00:00 2001 From: ssw Date: Sat, 27 Jun 2026 04:03:06 +0800 Subject: [PATCH] feat(storage-test): v0.11e+ enhanceFromBackend (Phase C2) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit storage/test.ts: - import enhanceFromBackend + formatErrorLine - 配置未找到时 enhanceFromBackend (而不是简单 log.error) --- src/commands/storage/test.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/commands/storage/test.ts b/src/commands/storage/test.ts index e8e2822..40ae1ea 100644 --- a/src/commands/storage/test.ts +++ b/src/commands/storage/test.ts @@ -14,6 +14,7 @@ import { JnpfClient } from '../../core/client.ts' import { readStorageConfig, defaultYmlPath } from './_helpers.ts' import { log, printJson } from '../../core/log.ts' import { installAiHelpHook } from '../../core/help.ts' +import { enhanceFromBackend, formatErrorLine } from '../_error_codes.ts' interface TestOpts { profile?: string @@ -40,7 +41,8 @@ export function buildStorageTestCommand(): Command { opts.type ? p.type === opts.type : p.enableStorage, ) if (targets.length === 0) { - log.error(`未找到匹配 platform (platform=${platform}, type=${opts.type}, 启用=${platform ? 'N/A' : 'enableStorage=true'})`) + const enhanced = enhanceFromBackend('未找到匹配 platform 配置', 'platform', { entity: 'storage' }) + log.error(` ${formatErrorLine(enhanced, { step: 0, stepName: '配置检查' })}`) process.exit(2) } const results: Array<{ platform: string; type: string; ok: boolean; msg: string; ms: number }> = []