mirror of
https://github.com/nlohmann/json.git
synced 2025-07-22 15:21:52 +03: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:
@ -924,7 +924,8 @@ TEST_CASE("regression tests")
|
||||
|
||||
l.m_stream->setstate(std::ios_base::failbit);
|
||||
|
||||
CHECK_THROWS_AS(l.fill_line_buffer(), std::invalid_argument);
|
||||
CHECK_THROWS_AS(l.fill_line_buffer(), json::parse_error);
|
||||
CHECK_THROWS_WITH(l.fill_line_buffer(), "[json.exception.parse_error.111] parse error: bad input stream");
|
||||
}
|
||||
|
||||
SECTION("setting badbit")
|
||||
@ -938,7 +939,8 @@ TEST_CASE("regression tests")
|
||||
|
||||
l.m_stream->setstate(std::ios_base::badbit);
|
||||
|
||||
CHECK_THROWS_AS(l.fill_line_buffer(), std::invalid_argument);
|
||||
CHECK_THROWS_AS(l.fill_line_buffer(), json::parse_error);
|
||||
CHECK_THROWS_WITH(l.fill_line_buffer(), "[json.exception.parse_error.111] parse error: bad input stream");
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user