chore: log exception when parsing weapon attachment json fails

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

View File

@ -44,8 +44,17 @@ namespace
return false;
}
const auto jAttachment = jRoot.get<JsonWeaponAttachment>();
return CreateWeaponAttachmentFromJson(jAttachment, attachment);
try
{
const auto jAttachment = jRoot.get<JsonWeaponAttachment>();
return CreateWeaponAttachmentFromJson(jAttachment, attachment);
}
catch (const json::exception& e)
{
std::cerr << std::format("Failed to parse json of attachment: {}\n", e.what());
}
return false;
}
private: