Skip to main content

AggregateError <Errors>

Alias to native globalThis.AggregateError

@example
import { AggregateError } from '@w5s/error';

try {
throw new AggregateError([new Error("some error")], "Hello");
} catch (e) {
console.log(e instanceof AggregateError); // true
console.log(e.message); // "Hello"
console.log(e.name); // "AggregateError"
console.log(e.errors); // [ Error: "some error" ]
}

Hierarchy

  • Error
    • AggregateError

Index

Constructors

Properties

Constructors

constructor

  • new AggregateError<Errors>(errors: Errors, message?: string): AggregateError<Errors>
  • AggregateError constructor


    Type parameters

    • Errors: any[] | Iterable<any, any, any>

Properties

errors

errors: Errors extends any[] ? [...Errors<Errors>[]][] : Errors extends Iterable<T, any, any> ? T[] : never

Array of error

name

name: AggregateError
Page Options