[ Web Proxy ]
URL:
Viewing: https://developer.mozilla.org/ko/docs/Web/JavaScript/Reference/Global_Objects/AggregateError [Back]  [Original]

AggregateError - JavaScript | MDN

This page was translated from English by the community. Learn more and join the MDN Web Docs community.

View in English Always switch to English

AggregateError

Baseline Widely available

This feature is well established and works across many devices and browser versions. Its been available across browsers since 2020 9.

AggregateError . , Promise.any() .

AggregateError Error .

In this article

AggregateError()

AggregateError .

Error .

AggregateError.prototype .

AggregateError.prototype.constructor

. AggregateError AggregateError .

AggregateError.prototype.name

. AggregateError.prototype.name "AggregateError".

AggregateError .

errors

.

Error .

AggregateError

js
Promise.any([Promise.reject(new Error("some error"))]).catch((e) => {
  console.log(e instanceof AggregateError); // true
  console.log(e.message); // "All Promises rejected"
  console.log(e.name); // "AggregateError"
  console.log(e.errors); // [ Error: "some error" ]
});

AggregateError

js
try {
  throw new AggregateError([new Error("some error")], "Hello");
} catch (e) {
  console.log(e instanceof AggregateError); // true
  console.log(e.message); // "Hello"
  console.log(e.name); // "AggregateError"
  console.log(e.errors); // [ Error: "some error" ]
}

Specification
ECMAScript 2027 LanguageSpecification
# sec-aggregate-error-objects


Web Proxy Viewer  |  New URL  |  Original Page