fix(doctor): handle missing service readCommand
This commit is contained in:
@@ -142,7 +142,12 @@ export async function maybeRepairGatewayServiceConfig(
|
|||||||
}
|
}
|
||||||
|
|
||||||
const service = resolveGatewayService();
|
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;
|
if (!command) return;
|
||||||
|
|
||||||
const audit = await auditGatewayServiceConfig({
|
const audit = await auditGatewayServiceConfig({
|
||||||
@@ -154,7 +159,9 @@ export async function maybeRepairGatewayServiceConfig(
|
|||||||
note(
|
note(
|
||||||
audit.issues
|
audit.issues
|
||||||
.map((issue) =>
|
.map((issue) =>
|
||||||
issue.detail ? `- ${issue.message} (${issue.detail})` : `- ${issue.message}`,
|
issue.detail
|
||||||
|
? `- ${issue.message} (${issue.detail})`
|
||||||
|
: `- ${issue.message}`,
|
||||||
)
|
)
|
||||||
.join("\n"),
|
.join("\n"),
|
||||||
"Gateway service config",
|
"Gateway service config",
|
||||||
|
|||||||
Reference in New Issue
Block a user