summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEd Tanous <ed.tanous@intel.com>2018-11-15 01:08:56 +0300
committerEd Tanous <ed.tanous@intel.com>2018-11-30 21:58:02 +0300
commit5f7d88c43ca389d0f053e0ce1aa3f3fc70f5f712 (patch)
tree12ce8e313a68ca2b0f81d0603356568111d86be5
parentea5c2908f54b4495e00c0da60fa28c46fe53825d (diff)
downloadbmcweb-5f7d88c43ca389d0f053e0ce1aa3f3fc70f5f712.tar.xz
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>
-rw-r--r--redfish-core/lib/sensors.hpp11
1 files changed, 3 insertions, 8 deletions
diff --git a/redfish-core/lib/sensors.hpp b/redfish-core/lib/sensors.hpp
index 8b829be079..b689f09664 100644
--- a/redfish-core/lib/sensors.hpp
+++ b/redfish-core/lib/sensors.hpp
@@ -68,11 +68,6 @@ class SensorsAsyncResp
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 @@ void getConnections(std::shared_ptr<SensorsAsyncResp> SensorsAsyncResp,
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 @@ void getChassis(std::shared_ptr<SensorsAsyncResp> SensorsAsyncResp,
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 @@ void getChassisData(std::shared_ptr<SensorsAsyncResp> SensorsAsyncResp)
{
BMCWEB_LOG_ERROR
<< "getManagedObjectsCb DBUS error: " << ec;
- SensorsAsyncResp->setErrorStatus();
+ messages::internalError(SensorsAsyncResp->res);
return;
}
// Go through all objects and update response with