mirror of
https://github.com/hedge-dev/UnleashedRecomp.git
synced 2025-10-30 07:11:05 +00:00
config: add exception handler
This commit is contained in:
parent
c8a7b65aa8
commit
bdfa5e874f
1 changed files with 41 additions and 34 deletions
|
|
@ -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()
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue