Skip to content

Commit 72c6057

Browse files
thomasballingerConvex, Inc.
authored andcommitted
Print more error info in network-test (#38510)
GitOrigin-RevId: fb5001f7b649c710ada7881a2aeeb77d514b05b0
1 parent 096b3b0 commit 72c6057

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/cli/lib/networkTest.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,10 +132,17 @@ async function checkTcpHostPort(
132132
)})`,
133133
);
134134
} catch (e: any) {
135+
let errorMessage = `${e}`;
136+
if (e instanceof AggregateError) {
137+
const individualErrors = e.errors
138+
.map((err, i) => ` ${i + 1}. ${err}`)
139+
.join("\n");
140+
errorMessage = `AggregateError with ${e.errors.length} errors:\n${individualErrors}`;
141+
}
135142
return ctx.crash({
136143
exitCode: 1,
137144
errorType: "transient",
138-
printedMessage: `FAIL: ${tcpString} connect (${e})`,
145+
printedMessage: `FAIL: ${tcpString} connect (${errorMessage})`,
139146
});
140147
}
141148
}

0 commit comments

Comments
 (0)