chore: log exception when parsing weapon camo json fails

This commit is contained in:
Jan 2024-08-08 18:50:35 +02:00
parent 774da9a584
commit 0707fa5873
No known key found for this signature in database
GPG Key ID: 44B581F78FF5C57C

View File

@ -39,9 +39,18 @@ namespace
return false; return false;
} }
try
{
const auto jWeaponCamo = jRoot.get<JsonWeaponCamo>(); const auto jWeaponCamo = jRoot.get<JsonWeaponCamo>();
return CreateWeaponCamoFromJson(jWeaponCamo, weaponCamo); return CreateWeaponCamoFromJson(jWeaponCamo, weaponCamo);
} }
catch (const json::exception& e)
{
std::cerr << std::format("Failed to parse json of weapon camo: {}\n", e.what());
}
return false;
}
private: private:
static void PrintError(const WeaponCamo& weaponCamo, const std::string& message) static void PrintError(const WeaponCamo& weaponCamo, const std::string& message)