fix: Improve error handling of ifstream a bit

Set the exceptions mask so that exceptions are thrown when an I/O error
occurs. Also throw the same exception type when the opening fails.
This commit is contained in:
Lukáš Hrázký
2022-09-08 16:58:56 +02:00
parent 021d84623c
commit 6c2c804eff
2 changed files with 3 additions and 2 deletions

View File

@@ -1031,5 +1031,5 @@ BOOST_AUTO_TEST_CASE(test_parse_function_compiles)
BOOST_AUTO_TEST_CASE(test_parse_nonexistent_file)
{
BOOST_CHECK_THROW(toml::parse("nonexistent.toml"), std::runtime_error);
BOOST_CHECK_THROW(toml::parse("nonexistent.toml"), std::ios_base::failure);
}