The MissingKeyError is thrown when an attempt is made to access a key that does not exist in the parsed data.

This error is commonly used in parsers to indicate that a required field is missing from the underlying data source.

throw new Parser.MissingKeyError("username");
// Error: Key "username" does not exist

Hierarchy (View Summary)

Constructors

Properties

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

Optional override for formatting stack traces

stackTraceLimit: number

Methods

  • Create .stack property on a target object

    Parameters

    • targetObject: object
    • OptionalconstructorOpt: Function

    Returns void

  • Create .stack property on a target object

    Parameters

    • targetObject: object
    • OptionalconstructorOpt: Function

    Returns void