Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Exception<L, D>

Type parameters

Hierarchy

  • Error
    • Exception

Implements

Index

Interfaces

Type aliases

Constructors

Properties

Accessors

Methods

Type aliases

Static Label

Label: string | null

An identifying label for exceptions to indicate their scope or origin

Constructors

constructor

  • new Exception(notice: string | [L, string], error?: Error | Empty, data?: D): Exception
  • Parameters

    • notice: string | [L, string]

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

    • Optional error: Error | Empty

      an optional source or original error that caused the exception

    • Optional data: D

      an optional data field

    Returns Exception

Properties

data

data: D

An optional data field.

error

error: Error

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

label

label: L

An optional label that identifies the exception.

message

message: string

Optional stack

stack: undefined | string

Static Error

Error: ErrorConstructor

Accessors

name

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

    Returns string

Methods

root

Static from

  • Creates an Exception from any exception-like object. When item is an Exception, a new instance will not be created.

    Type parameters

    Parameters

    Returns Exception<L, D>

Static is

  • is<L>(item: any, label?: L): item is Exception<L>
  • 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
    • Optional label: L

    Returns item is Exception<L>

Generated using TypeDoc