There was an error while loading. Please reload this page.
AggregateError
1 parent 8e08f5b commit a3a7b74Copy full SHA for a3a7b74
src/utils/index.ts
@@ -52,13 +52,13 @@ export const exportedUris: Set<string> = new Set();
52
export const identifierRegex = /^(?:%|\p{L})[\p{L}\d]*$/u;
53
54
/**
55
- * Return a string represenattion of `error`.
+ * Return a string representation of `error`.
56
* If `error` is `undefined`, returns the empty string.
57
*/
58
export function stringifyError(error): string {
59
try {
60
- if (error instanceof AggregateError) {
61
- // Need to stringify the inner errors
+ if (Array.isArray(error?.errors)) {
+ // Need to stringify the inner errors of an AggregateError
62
const errs = error.errors.map(stringifyError).filter((s) => s != "");
63
return errs.length ? `AggregateError:\n- ${errs.join("\n- ")}` : "";
64
}
0 commit comments