Skip to content

Commit

Permalink
refactor(internal): Make better use of endo makeError (#10070)
Browse files Browse the repository at this point in the history
Ref #10055

## Description
The internal `makeAggregateError` introduced by #10055 properly logged fake-AggregateError errors, but failed to expose them on the error object. But this is [already supported in endo](https://github.com/endojs/endo/blob/4406f5dde521d539a5effeb8ab68c1316e45261d/packages/ses/src/error/assert.js#L321), so we should use it.

### Security Considerations
n/a

### Scaling Considerations
n/a

### Documentation Considerations
n/a

### Testing Considerations
n/a

### Upgrade Considerations
n/a
  • Loading branch information
mergify[bot] authored Sep 11, 2024
2 parents 07f6885 + 4ca4f87 commit 3656582
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 3656582

Please sign in to comment.