Skip to main content

ErrorClass <Name>

Hierarchy

Index

Constructors

constructor

constructor:

constructor

  • new ErrorClass<Properties>(...properties): Readonly<Error & { cause: unknown; message: string; name: { name: Name } & Properties[name]; stack: string } & { name: Name } & Properties>
  • Error constructor

Properties

readonlyerrorName

errorName: Name

Error name

readonlyinheritedprototype

prototype: Readonly<Error & { cause: unknown; message: string; name: string; stack: string } & CustomErrorRequiredProperties>

Methods

inheritedasString

  • asString(self): string
  • Static method to convert an error to a string

    @example
    CustomError.asString(new Error('my message'));

inheritedhasInstance

  • hasInstance<Class>(this, anyValue): anyValue is InstanceType<Class>
  • Return true if anyValue is an instance of current class