From fffe30725f33e227f4a587c108d65727a4a753b3 Mon Sep 17 00:00:00 2001 From: Brett Saviano Date: Fri, 12 Sep 2025 14:07:07 -0400 Subject: [PATCH] Fix stringification of `AggregateError`s --- src/utils/index.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/utils/index.ts b/src/utils/index.ts index 78129e3d..7a4cb880 100644 --- a/src/utils/index.ts +++ b/src/utils/index.ts @@ -52,13 +52,13 @@ export const exportedUris: Set = new Set(); export const identifierRegex = /^(?:%|\p{L})[\p{L}\d]*$/u; /** - * Return a string represenattion of `error`. + * Return a string representation of `error`. * If `error` is `undefined`, returns the empty string. */ export function stringifyError(error): string { try { - if (error instanceof AggregateError) { - // Need to stringify the inner errors + if (Array.isArray(error?.errors)) { + // Need to stringify the inner errors of an AggregateError const errs = error.errors.map(stringifyError).filter((s) => s != ""); return errs.length ? `AggregateError:\n- ${errs.join("\n- ")}` : ""; }