Construction: The constructor AggregateError() is used to create a new object of AggregateError.
Instance Properties: This object has two properties:
- message: We use the AggregateError.prototype.message to display the message of error. The default error message shown is ” “.
- name: We use the AggregateError.prototype.name to display the name of error. The default error name shown is AggregateError.
Example 1: This example shows the catching of an AggregateError.
true All promises were rejected AggregateError [Error: There is any error occured]
Example 2: This example shows the creating of an AggregateError.
true These are multiple errors AggregateError [Error: This is Error 1, Error: This is Error 2, Error: This is Error 3]