Errorsclass
new Errors(errors: Iterable<unknown>, message?: string, options: BaseErrorOptions = {})| Param | Type | |
|---|---|---|
errors | Iterable<unknown> | Iterable of the individual errors being aggregated. required |
message | string | Optional human-readable message describing the aggregate failure. |
options | BaseErrorOptions | Options for BaseError that provide additional helpful error functionality. Defaults to {} |
.caller | AnyCaller | Modify the stack to trim off lines after a certain calling function. |
| Return | |
|---|---|
Errors | Aggregate an array of errors into a single combined error. |
Aggregate an array of errors into a single combined error.
- Extends (and shadows) the built-in
AggregateErrorbut with additional allowed options likecaller.
Examples
throw new Errors([new ValueError("Bad name"), new ValueError("Bad age")], "Validation failed");