Skip to content

Commit

Permalink
Print AggregateError's properly (#1027)
Browse files Browse the repository at this point in the history
  • Loading branch information
firecow authored Nov 10, 2023
1 parent dbc3ba9 commit f5e4aa3
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ process.on("SIGINT", (_: string, code: number) => {
} catch (e: any) {
if (e instanceof AssertionError) {
process.stderr.write(chalk`{red ${e.message.trim()}}\n`);
} else if (e instanceof AggregateError) {
e.errors.forEach((aggE) => process.stderr.write(chalk`{red ${aggE.stack ?? aggE}}\n`));
} else {
process.stderr.write(chalk`{red ${e.stack ?? e}}\n`);
}
Expand Down

0 comments on commit f5e4aa3

Please sign in to comment.