fix(config): name malformed local identity errors

This commit is contained in:
2026-09-05 14:36:00 +08:00
parent 34be99d84a
commit c6f1103b32
2 changed files with 24 additions and 2 deletions
@@ -96,8 +96,12 @@ export function assertLocalStartupContext(context: LocalStartupContext): void {
try {
resolveIdentity([() => config.identity]);
} catch (error) {
if (error instanceof Error) throw error;
fail('identity', 'is invalid');
const reason = error instanceof Error ? error.message : 'validation failed';
const wrapped = new Error(`Invalid local startup identity: ${reason}`) as Error & {
cause?: unknown;
};
wrapped.cause = error;
throw wrapped;
}
const authoritative = PROFILES.local?.servers;