config: add exception handler

This commit is contained in:
Hyper 2024-10-20 00:14:57 +01:00
parent c8a7b65aa8
commit bdfa5e874f

View file

@ -1,5 +1,7 @@
void Config::Load() void Config::Load()
{ {
try
{
auto toml = toml::parse_file(TOML_FILE); auto toml = toml::parse_file(TOML_FILE);
TOML_BEGIN_SECTION("System") TOML_BEGIN_SECTION("System")
@ -39,6 +41,11 @@ void Config::Load()
TOML_READ_INTEGER(BufferCount); TOML_READ_INTEGER(BufferCount);
} }
TOML_END_SECTION(); TOML_END_SECTION();
}
catch (toml::parse_error& err)
{
printf("Failed to parse configuration: %s\n", err.what());
}
} }
void Config::Save() void Config::Save()