fix(doctor): handle missing service readCommand

This commit is contained in:
Peter Steinberger
2026-01-08 21:38:51 +01:00
parent 23e34dd598
commit ea748f9440

View File

@@ -142,7 +142,12 @@ export async function maybeRepairGatewayServiceConfig(
}
const service = resolveGatewayService();
const command = await service.readCommand(process.env).catch(() => null);
let command: Awaited<ReturnType<typeof service.readCommand>> | null = null;
try {
command = await service.readCommand(process.env);
} catch {
command = null;
}
if (!command) return;
const audit = await auditGatewayServiceConfig({
@@ -154,7 +159,9 @@ export async function maybeRepairGatewayServiceConfig(
note(
audit.issues
.map((issue) =>
issue.detail ? `- ${issue.message} (${issue.detail})` : `- ${issue.message}`,
issue.detail
? `- ${issue.message} (${issue.detail})`
: `- ${issue.message}`,
)
.join("\n"),
"Gateway service config",