Make chassis errors return the appropriate message
Previously, chassis errors would only return 500, and a blank body.
This change causes chassis errors to return the appropriate
internalError implementation.
Change-Id: I75454c334a0bd4870725bc9381a68af08e3eab80
Signed-off-by: Ed Tanous <ed.tanous@intel.com>
diff --git a/redfish-core/lib/sensors.hpp b/redfish-core/lib/sensors.hpp
index 8b829be..b689f09 100644
--- a/redfish-core/lib/sensors.hpp
+++ b/redfish-core/lib/sensors.hpp
@@ -68,11 +68,6 @@
res.end();
}
- void setErrorStatus()
- {
- res.result(boost::beast::http::status::internal_server_error);
- }
-
crow::Response& res;
std::string chassisId{};
const std::vector<const char*> types;
@@ -102,7 +97,7 @@
BMCWEB_LOG_DEBUG << "getConnections resp_handler enter";
if (ec)
{
- SensorsAsyncResp->setErrorStatus();
+ messages::internalError(SensorsAsyncResp->res);
BMCWEB_LOG_ERROR << "getConnections resp_handler: Dbus error "
<< ec;
return;
@@ -186,7 +181,7 @@
if (ec)
{
BMCWEB_LOG_ERROR << "getChassis respHandler DBUS error: " << ec;
- SensorsAsyncResp->setErrorStatus();
+ messages::internalError(SensorsAsyncResp->res);
return;
}
boost::container::flat_set<std::string> sensorNames;
@@ -438,7 +433,7 @@
{
BMCWEB_LOG_ERROR
<< "getManagedObjectsCb DBUS error: " << ec;
- SensorsAsyncResp->setErrorStatus();
+ messages::internalError(SensorsAsyncResp->res);
return;
}
// Go through all objects and update response with