Error class for parse errors.

Remarks

This error is thrown when a parsing error occurs. ParseError is a subclass of SyntaxError.

This is in reference to the specification that the error thrown when a parse error occurs in the JSON.parse function is SyntaxError.

Hierarchy

Constructors

Properties

cause?: unknown
message: string
name: string
position?: Position

The position where the error occurred.

stack?: string
prepareStackTrace?: ((err, stackTraces) => any)

Optional override for formatting stack traces

Type declaration

    • (err, stackTraces): any
    • Parameters

      • err: Error
      • stackTraces: CallSite[]

      Returns any

stackTraceLimit: number

Methods

  • Create .stack property on a target object

    Parameters

    • targetObject: object
    • Optional constructorOpt: Function

    Returns void