feat(storage-test): v0.11e+ enhanceFromBackend (Phase C2)

storage/test.ts:
- import enhanceFromBackend + formatErrorLine
- 配置未找到时 enhanceFromBackend (而不是简单 log.error)
This commit is contained in:
ssw committed 2026-06-27 04:03:06 +08:00
1 parent 4218cc51e1
commit fdcb377fb5
1 file changed
+3 -1
+3 -1
View File
@@ -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 }> = []