From 4ca4f870f637f211f67697515d8fb9f6b0fa491d Mon Sep 17 00:00:00 2001 From: Richard Gibson Date: Wed, 11 Sep 2024 15:13:52 -0400 Subject: [PATCH] refactor(internal): Make better use of endo makeError Ref #10055 --- packages/internal/src/utils.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/internal/src/utils.js b/packages/internal/src/utils.js index 3a5f702a092..0733fbf2deb 100644 --- a/packages/internal/src/utils.js +++ b/packages/internal/src/utils.js @@ -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, + }); }; /**