Standard built-ins
AggregateError()
Creates an Error holding an array of values collected from an iterable. The values need not be Error objects.
Formal Syntax & Structure
javascript syntaxjavascript
new AggregateError(errors, [message], [options])Parameters & Attributes
| Name | Type | Description |
|---|---|---|
| errors | Iterable | Values representing individual failures. |
| message | String | Diagnostic message. |
| options | Object | Optional cause property. |
Return Value
AggregateError
Error with errors array.
Working Example
Example Snippetjavascript
console.log(new AggregateError([new Error("a"), new Error("b")],"failed").errors.length);