mirror of
https://github.com/nlohmann/json.git
synced 2026-03-11 19:51:24 +00:00
🔨 added user-defined exception #493
Replaced old std::invalid_argument exception by parse_error.111 to have unified exceptions in case of input stream errors.
This commit is contained in:
@@ -11334,7 +11334,7 @@ basic_json_parser_74:
|
||||
// check if stream is still good
|
||||
if (m_stream->fail())
|
||||
{
|
||||
JSON_THROW(std::invalid_argument("stream error"));
|
||||
JSON_THROW(parse_error(111, 0, "bad input stream"));
|
||||
}
|
||||
|
||||
std::getline(*m_stream, m_line_buffer_tmp, '\n');
|
||||
|
||||
@@ -10367,7 +10367,7 @@ class basic_json
|
||||
// check if stream is still good
|
||||
if (m_stream->fail())
|
||||
{
|
||||
JSON_THROW(std::invalid_argument("stream error"));
|
||||
JSON_THROW(parse_error(111, 0, "bad input stream"));
|
||||
}
|
||||
|
||||
std::getline(*m_stream, m_line_buffer_tmp, '\n');
|
||||
|
||||
Reference in New Issue
Block a user