Handle exceptions at loading patch file

This commit is contained in:
Nekotekina 2018-01-30 00:26:22 +03:00
parent 17ce5d9117
commit d66e56392e

View file

@ -32,7 +32,17 @@ void patch_engine::append(const std::string& patch)
{
if (fs::file f{patch})
{
auto root = YAML::Load(f.to_string());
YAML::Node root;
try
{
root = YAML::Load(f.to_string());
}
catch (const std::exception& e)
{
LOG_FATAL(GENERAL, "Failed to load patch file %s\n%s thrown: %s", patch, typeid(e).name(), e.what());
return;
}
for (auto pair : root)
{