Class ParsingError<T>

This error is used to explain why parsing failed.

Type Parameters

  • T

Hierarchy (view full)

Constructors

  • Creates an instance of the error with a specified message and invalid reason.

    Type Parameters

    • T

    Parameters

    • message: string

      The error message that describes the issue.

    • invalidReason: T

      The reason why the input is considered invalid.

    Returns ParsingError<T>

Methods

  • Create .stack property on a target object

    Parameters

    • targetObject: object
    • OptionalconstructorOpt: Function

    Returns void

Properties

invalidReason: T

This provides a programmatic way to access why parsing failed. Downstream devs might want to use this to build their own error messages if the default error messages are not suitable for their use case. This should be an enum.

message: string
name: string
stack?: string
prepareStackTrace?: ((err: Error, stackTraces: CallSite[]) => any)

Optional override for formatting stack traces

stackTraceLimit: number