chore: log exception when parsing xmodel json fails

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

View File

@ -40,9 +40,18 @@ namespace
return false; return false;
} }
try
{
const auto jXModel = jRoot.get<JsonXModel>(); const auto jXModel = jRoot.get<JsonXModel>();
return CreateXModelFromJson(jXModel, xmodel); return CreateXModelFromJson(jXModel, xmodel);
} }
catch (const json::exception& e)
{
std::cerr << std::format("Failed to parse json of xmodel: {}\n", e.what());
}
return false;
}
private: private:
static void PrintError(const XModel& xmodel, const std::string& message) static void PrintError(const XModel& xmodel, const std::string& message)