Make D-bus systemd error handling consistent
Make consistent with the extra error handling added to the
chassis_state_manager.cpp code
Signed-off-by: Andrew Geissler <geissonator@yahoo.com>
Change-Id: I144a692a0472b1db9b45dc14444dd39081c7387a
diff --git a/bmc_state_manager.cpp b/bmc_state_manager.cpp
index 92d9ef8..1ab3f7e 100644
--- a/bmc_state_manager.cpp
+++ b/bmc_state_manager.cpp
@@ -1,8 +1,10 @@
#include <cassert>
#include <phosphor-logging/log.hpp>
+#include <phosphor-logging/elog-errors.hpp>
#include <sdbusplus/exception.hpp>
#include <sys/sysinfo.h>
#include "bmc_state_manager.hpp"
+#include "xyz/openbmc_project/Common/error.hpp"
namespace phosphor
{
@@ -16,6 +18,7 @@
using namespace phosphor::logging;
using sdbusplus::exception::SdBusError;
+using sdbusplus::xyz::openbmc_project::Common::Error::InternalFailure;
constexpr auto obmcStandbyTarget = "multi-user.target";
constexpr auto signalDone = "done";
@@ -115,7 +118,9 @@
}
catch (const SdBusError& e)
{
- log<level::INFO>("Error in Subscribe", entry("ERROR=%s", e.what()));
+ log<level::ERR>("Failed to subscribe to systemd signals",
+ entry("ERR=%s", e.what()));
+ elog<InternalFailure>();
}
return;