Aller au contenu principal

ArgumentError

ArgumentError constructor. An error when wrong argument is passed to a function

Hierarchy

  • Readonly<Error & { cause: unknown; message: string; name: ArgumentError; stack: string } & { name: ArgumentError }>
    • ArgumentError

Index

Constructors

Properties

Methods

Constructors

constructor

  • Error constructor

Properties

staticreadonlyerrorName

errorName: ArgumentError

Error name

Methods

staticasString

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

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

statichasInstance

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


    Type parameters

    • Class: new (...args: any) => any