You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
TC39 has proposed a new type of Error object AggregateError for handling multiple errors (Stage 3). They use it capture error from Promise.any(). But similar ideas have been used by userland libraries in the past. And now it is official and polyfills are also available.
Please consider the use of AggregateError to consolidate error messages.
The text was updated successfully, but these errors were encountered:
I've looked at it again, and realized that AggregateError is conceptually different than our implementation. When we throw in copy, we provide information on what requests failed and what requests succeeded. Using AggregateError we would only provide on information on the failures.
So if we'd want to use it, we would need to extend it and add support for successful responses. We use a Promise.allSettled method¹, which has success and failure outcomes. The error thrown would need to reflect this.
¹ and we probably shouldn't write the polyfill for allSettled ourselves here but just let babel do it.
TC39 has proposed a new type of
Error
objectAggregateError
for handling multiple errors (Stage 3). They use it capture error from Promise.any(). But similar ideas have been used by userland libraries in the past. And now it is official and polyfills are also available.Please consider the use of AggregateError to consolidate error messages.
The text was updated successfully, but these errors were encountered: