Make propertyValueFormatError more typesafe
Similar to other patches, make propertyValueFormatError accept a
nlohmann::json object, which removes a lot of the unsafe dump code that
we have littered about.
Tested: No easy to replicate error. Code is identical to previous
patchsets. Inspection and code compilation only.
Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: Ic9d0f196b6e198073189f744b738db7ffa2f1b74
diff --git a/redfish-core/lib/managers.hpp b/redfish-core/lib/managers.hpp
index 362fdef..5bb4908 100644
--- a/redfish-core/lib/managers.hpp
+++ b/redfish-core/lib/managers.hpp
@@ -707,7 +707,7 @@
if (config.empty())
{
BMCWEB_LOG_ERROR << "Empty Zones";
- messages::propertyValueFormatError(response->res, "[]", "Zones");
+ messages::propertyValueFormatError(response->res, config, "Zones");
return false;
}
for (auto& odata : config)
@@ -727,8 +727,7 @@
{
BMCWEB_LOG_ERROR << "Got invalid path " << path;
BMCWEB_LOG_ERROR << "Illegal Type Zones";
- messages::propertyValueFormatError(response->res, odata.dump(),
- "Zones");
+ messages::propertyValueFormatError(response->res, odata, "Zones");
return false;
}
std::replace(input.begin(), input.end(), '_', ' ');