The Error class is a custom error type used by the Parser class and its
subclasses to signal errors during parsing and validation of structured
data.
This class extends the global Error class and provides a consistent
error name (ParserError) for all parser-related errors, making it easier
to identify and handle parser-specific exceptions.
Example
thrownewParser.Error("Something went wrong"); // Error: Something went wrong
The
Error
class is a custom error type used by theParser
class and its subclasses to signal errors during parsing and validation of structured data.This class extends the global
Error
class and provides a consistent error name (ParserError
) for all parser-related errors, making it easier to identify and handle parser-specific exceptions.Example