[Core] Report the actual reason config parse failed.
This commit is contained in:
parent
53b564c1a6
commit
9a9a55aa49
|
@ -21,8 +21,9 @@ bool sortCvar(cvar::IConfigVar* a, cvar::IConfigVar* b) {
|
||||||
std::shared_ptr<cpptoml::table> ParseConfig(std::string config_path) {
|
std::shared_ptr<cpptoml::table> ParseConfig(std::string config_path) {
|
||||||
try {
|
try {
|
||||||
return cpptoml::parse_file(config_path);
|
return cpptoml::parse_file(config_path);
|
||||||
} catch (cpptoml::parse_exception) {
|
} catch (cpptoml::parse_exception e) {
|
||||||
xe::FatalError("Failed to parse config file: %s", config_path.c_str());
|
xe::FatalError("Failed to parse config file '%s':\n\n%s",
|
||||||
|
config_path.c_str(), e.what());
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue