The MissingKeyError is thrown when an attempt is made to access a key that does not exist in the parsed data.
MissingKeyError
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 Copy
throw new Parser.MissingKeyError("username");// Error: Key "username" does not exist
Constructs a new MissingKeyError with the specified key name.
The name of the missing key.
Optional
Static
Optional override for formatting stack traces
https://v8.dev/docs/stack-trace-api#customizing-stack-traces
Create .stack property on a target object
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.
Example