ci: Catch std::exception on toml::parse_file
This commit is contained in:
parent
9c9feba565
commit
a32463586c
2 changed files with 3 additions and 4 deletions
|
|
@ -67,6 +67,9 @@ bool Config::load(const std::string &firstArg)
|
||||||
} catch (const toml::parse_error &err) {
|
} catch (const toml::parse_error &err) {
|
||||||
LOG((CLOG_ERR "toml parse error: %s", err.what()));
|
LOG((CLOG_ERR "toml parse error: %s", err.what()));
|
||||||
throw ParseError();
|
throw ParseError();
|
||||||
|
} catch (const std::exception &err) {
|
||||||
|
LOG((CLOG_ERR "unknown parse error: %s", err.what()));
|
||||||
|
throw ParseError();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!configTable.contains(m_section)) {
|
if (!configTable.contains(m_section)) {
|
||||||
|
|
|
||||||
|
|
@ -62,9 +62,6 @@ TEST(ConfigTests, load_fileDoesNotExist_returnsFalse)
|
||||||
ASSERT_FALSE(result);
|
ASSERT_FALSE(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
// HACK: Disable on FreeBSD, because of error:
|
|
||||||
// "Error while parsing key-value pair: encountered end-of-file".
|
|
||||||
#if !defined(__FreeBSD__)
|
|
||||||
TEST(ConfigTests, load_invalidConfig_throwsException)
|
TEST(ConfigTests, load_invalidConfig_throwsException)
|
||||||
{
|
{
|
||||||
EXPECT_THROW(
|
EXPECT_THROW(
|
||||||
|
|
@ -80,7 +77,6 @@ TEST(ConfigTests, load_invalidConfig_throwsException)
|
||||||
Config::ParseError
|
Config::ParseError
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
TEST(ConfigTests, load_sectionMissing_returnsFalse)
|
TEST(ConfigTests, load_sectionMissing_returnsFalse)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue