Aller au contenu principal

TypeError

Alias to native globalThis.TypeError

@example
import { TypeError } from '@w5s/error';

try {
throw new TypeError("Hello");
} catch (e) {
console.log(e instanceof TypeError); // true
console.log(e.message); // "Hello"
console.log(e.name); // "TypeError"
console.log(e.stack); // Stack of the error
}

Hierarchy

  • Error
    • TypeError

Index

Constructors

Properties

Constructors

externalconstructor

  • new TypeError(message?: string): TypeError
  • new TypeError(message?: string, options?: ErrorOptions): TypeError

Properties

name

name: TypeError
Page Options