chore: log exception when parsing material json fails

This commit is contained in:
Jan 2024-08-08 18:27:00 +02:00
parent bec082fc0c
commit f452270f8a
No known key found for this signature in database
GPG Key ID: 44B581F78FF5C57C

View File

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