mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-04-28 13:28:01 +03:00
Handle exceptions at loading patch file
This commit is contained in:
parent
17ce5d9117
commit
d66e56392e
1 changed files with 13 additions and 3 deletions
|
@ -32,13 +32,23 @@ 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)
|
||||||
{
|
{
|
||||||
auto& name = pair.first.Scalar();
|
auto& name = pair.first.Scalar();
|
||||||
auto& data = m_map[name];
|
auto& data = m_map[name];
|
||||||
|
|
||||||
for (auto patch : pair.second)
|
for (auto patch : pair.second)
|
||||||
{
|
{
|
||||||
u64 type64 = 0;
|
u64 type64 = 0;
|
||||||
|
@ -91,7 +101,7 @@ void patch_engine::append(const std::string& patch)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
data.emplace_back(info);
|
data.emplace_back(info);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue