Class Exception<L, D>

An exception-like object

Type Parameters

Hierarchy

  • Error
    • Exception

Implements

Constructors

Properties

Accessors

Methods

Constructors

  • Type Parameters

    Parameters

    • notice: string | [L, string]

      a message string or an array containing a label and a message

    • Optionalerror: null | Error

      an optional source or original error that caused the exception

    • Optionaldata: D

      an optional data field

    Returns Exception<L, D>

Properties

data: D

An optional data field.

error: Error

A source error causing the exception or a reference to itself.

label: L

An optional label that identifies the exception.

Accessors

  • get name(): string
  • Exception.name will have value "Exception" or "Exception [label]" instead of "Error"

    Returns string

Methods

  • Tests whether an item is an instance of the Exception class or any class inheriting from it. When item is an Exception, it will optionally test for the instance also having a specific label.

    Type Parameters

    Parameters

    • item: any
    • Optionallabel: L

    Returns item is Exception<L, any>