impr: Better JSON error handling in many places

This commit is contained in:
WerWolv
2023-05-16 11:33:00 +02:00
parent 7e9b23de7d
commit 3bd4a3ba8b
14 changed files with 46 additions and 45 deletions

View File

@@ -18,7 +18,7 @@ namespace hex::plugin::builtin {
.required = false,
.load = [](prv::Provider *provider, const std::fs::path &basePath, Tar &tar) {
auto json = nlohmann::json::parse(tar.readString(basePath));
provider->getPatches() = json["patches"].get<std::map<u64, u8>>();
provider->getPatches() = json.at("patches").get<std::map<u64, u8>>();
return true;
},
.store = [](prv::Provider *provider, const std::fs::path &basePath, Tar &tar) {