Update parser.hpp #4037 Improve wording of parse_error exception done

This commit is contained in:
Ankush Mondal 2023-08-19 19:14:36 +05:30 committed by GitHub
parent 5d2754306d
commit 9704c94cf2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -479,6 +479,10 @@ class parser
error_msg += concat(m_lexer.get_error_message(), "; last read: '",
m_lexer.get_token_string(), '\'');
}
else if (last_token == token_type::end_of_input && m_lexer.get_position().chars_read_total == 1)
{
error_msg += concat("Error attempting to parse an empty input, check that your input string or stream contains the expected JSON.");
}
else
{
error_msg += concat("unexpected ", lexer_t::token_type_name(last_token));