Aller au contenu principal

SyntaxError

Alias to native globalThis.SyntaxError

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

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

Hierarchy

  • Error
    • SyntaxError

Index

Constructors

Properties

Constructors

externalconstructor

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

Properties

name

name: SyntaxError
Page Options