A collection of errors. AggregateError is an array-like object, with numeric indices and a .length property. It supports all generic array methods such as .forEach directly.

AggregateErrors are caught in .error handlers, even if the contained errors are not operational.

Promise.some and Promise.any use AggregateError as rejection reason when they fail.

Hierarchy

Implements

Indexable

[index: number]: Error

Constructors

  • Parameters

    • Optional message: string

    Returns AggregateError

Properties

length: number
message: string
name: string
stack?: string
prepareStackTrace?: ((err: Error, stackTraces: CallSite[]) => any)

Type declaration

stackTraceLimit: number

Methods

  • Parameters

    Returns boolean

  • Parameters

    Returns undefined

  • Parameters

    • searchElement: Error
    • Optional fromIndex: number

    Returns number

  • Parameters

    • Optional separator: string

    Returns string

  • Parameters

    • searchElement: Error
    • Optional fromIndex: number

    Returns number

  • Returns Error

  • Parameters

    Returns number

  • Parameters

    • callback: ((accumulator: any, element: Error, index: number, array: AggregateError) => any)
    • Optional initialValue: any

    Returns any

  • Parameters

    • callback: ((previousValue: any, element: Error, index: number, array: AggregateError) => any)
    • Optional initialValue: any

    Returns any

  • Returns Error

  • Parameters

    • Optional begin: number
    • Optional end: number

    Returns AggregateError

  • Parameters

    Returns boolean

  • Parameters

    • Optional compareFunction: ((errLeft: Error, errRight: Error) => number)

    Returns AggregateError

  • Parameters

    Returns number

  • Create .stack property on a target object

    Parameters

    • targetObject: object
    • Optional constructorOpt: Function

    Returns void