Handle exceptions at loading patch file
This commit is contained in:
+11
-1
@@ -32,7 +32,17 @@ void patch_engine::append(const std::string& patch)
|
|||||||
{
|
{
|
||||||
if (fs::file f{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)
|
for (auto pair : root)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user