Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,13 @@ export const exportedUris: Set<string> = 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- ")}` : "";
}
Expand Down