AggregateError()
The AggregateError()
constructor creates an error for several errors that need to be wrapped in a single error.
Syntax
new AggregateError(errors)
new AggregateError(errors, message)
new AggregateError(errors, message, options)
AggregateError(errors)
AggregateError(errors, message)
AggregateError(errors, message, options)
Note:
AggregateError()
can be called with or withoutnew
. Both create a newAggregateError
instance.
Parameters
errors
- : An iterable of errors, may not actually be
TypeError
instances.
- : An iterable of errors, may not actually be
message
optional- : An optional human-readable description of the aggregate error.
options
optional- : An object that has the following properties:
cause
optional- : A property indicating the specific cause of the error. When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error.
- : An object that has the following properties: