Spec-Zone.ru › JavaScript

AggregateError: errors

Baseline Widely available

This feature is well established and works across many devices and browser versions. It's been available across browsers since September 2020.

The errors data property of an AggregateError instance contains an array representing the errors that were aggregated.

Value

An Array containing values in the same order as the iterable passed as the first argument of the AggregateError() constructor.

Property attributes of AggregateError: errors
Writable yes
Enumerable no
Configurable yes

Examples

Using errors

try {
  throw new AggregateError(
    // An iterable of errors
    new Set([new Error("some error"), new Error("another error")]),
    "Multiple errors thrown",
  );
} catch (err) {
  console.log(err.errors);
  // [
  //   Error: some error,
  //   Error: another error
  // ]
}

Specifications

Specification
ECMAScript® 2027 Language Specification
# sec-aggregate-error

Browser compatibility

Desktop Mobile Server
Chrome Edge Firefox Opera Safari Chrome Android Firefox for Android Opera Android Safari on iOS Samsung Internet WebView Android WebView on iOS Bun Deno Node.js
errors
85
85
79
71
14
85
79
60
14
14.0
85
14
1.0.0
1.2
15.0.0

See also

  • Control flow and error handling guide
  • AggregateError
  • Error: cause

© 2005–2025 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/AggregateError/errors

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API