Skip to content

Commit

Permalink
refactor(internal): Make better use of endo makeError
Browse files Browse the repository at this point in the history
Ref #10055
  • Loading branch information
gibson042 committed Sep 11, 2024
1 parent 07f6885 commit 4ca4f87
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions packages/internal/src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,10 @@ const makeAggregateError =
typeof AggregateError === 'function'
? (errors, message, options) => AggregateError(errors, message, options)
: (errors, message, options) => {
const err = makeError(message ?? 'multiple errors', undefined, options);
annotateError(err, X`${errors}`);
return err;
return makeError(message ?? 'multiple errors', undefined, {
...options,
errors,
});
};

/**
Expand Down

0 comments on commit 4ca4f87

Please sign in to comment.