Skip to content

Commit 80e997d

Browse files
authored
Fully stringify AggregateError when writing to the Output channel (#1639)
1 parent 8e1c5ad commit 80e997d

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/utils/index.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,11 @@ export const identifierRegex = /^(?:%|\p{L})[\p{L}\d]*$/u;
5757
*/
5858
export function stringifyError(error): string {
5959
try {
60+
if (error instanceof AggregateError) {
61+
// Need to stringify the inner errors
62+
const errs = error.errors.map(stringifyError).filter((s) => s != "");
63+
return errs.length ? `AggregateError:\n- ${errs.join("\n- ")}` : "";
64+
}
6065
return (
6166
error == undefined
6267
? ""

0 commit comments

Comments
 (0)