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,4 +1,6 @@
void Config::Load() void Config::Load()
{
try
{ {
auto toml = toml::parse_file(TOML_FILE); auto toml = toml::parse_file(TOML_FILE);
@ -40,6 +42,11 @@ void Config::Load()
} }
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()
{ {