Documentación offline JavaScript main

AggregateError: errors

main Documentación oficial Licencia CC-BY-SA-2.5Descargado el 2026-08-02

En esta página

The errors data property of an {{jsxref("AggregateError")}} instance contains an array representing the errors that were aggregated.

Value#

An {{jsxref("Array")}} containing values in the same order as the iterable passed as the first argument of the {{jsxref("AggregateError/AggregateError", "AggregateError()")}} constructor.

{{js_property_attributes(1, 0, 1)}}

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#

{{Specifications}}

Browser compatibility#

{{Compat}}

See also#