summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--activation.cpp8
-rw-r--r--ubi/item_updater_helper.cpp18
2 files changed, 17 insertions, 9 deletions
diff --git a/activation.cpp b/activation.cpp
index a938b8b..73acc3d 100644
--- a/activation.cpp
+++ b/activation.cpp
@@ -205,9 +205,11 @@ void Activation::deleteImageManagerObject()
auto method = this->bus.new_method_call(VERSION_BUSNAME, path.c_str(),
"xyz.openbmc_project.Object.Delete",
"Delete");
- auto mapperResponseMsg = bus.call(method);
- // Check that the bus call didn't result in an error
- if (mapperResponseMsg.is_method_error())
+ try
+ {
+ bus.call_noreply(method);
+ }
+ catch (const SdBusError& e)
{
log<level::ERR>("Error in Deleting image from image manager",
entry("VERSIONPATH=%s", path.c_str()));
diff --git a/ubi/item_updater_helper.cpp b/ubi/item_updater_helper.cpp
index 68162cb..a699d5f 100644
--- a/ubi/item_updater_helper.cpp
+++ b/ubi/item_updater_helper.cpp
@@ -3,6 +3,7 @@
#include "item_updater_helper.hpp"
#include <phosphor-logging/log.hpp>
+#include <sdbusplus/exception.hpp>
namespace phosphor
{
@@ -12,6 +13,7 @@ namespace updater
{
using namespace phosphor::logging;
+using sdbusplus::exception::SdBusError;
void Helper::setEntry(const std::string& entryId, uint8_t value)
{
@@ -69,10 +71,12 @@ void Helper::updateUbootVersionId(const std::string& versionId)
auto updateEnvVarsFile =
"obmc-flash-bmc-updateubootvars@" + versionId + ".service";
method.append(updateEnvVarsFile, "replace");
- auto result = bus.call(method);
- // Check that the bus call didn't result in an error
- if (result.is_method_error())
+ try
+ {
+ bus.call_noreply(method);
+ }
+ catch (const SdBusError& e)
{
log<level::ERR>("Failed to update u-boot env variables",
entry("VERSIONID=%s", versionId.c_str()));
@@ -105,10 +109,12 @@ void Helper::mirrorAlt()
SYSTEMD_INTERFACE, "StartUnit");
auto mirrorUbootFile = "obmc-flash-bmc-mirroruboot.service";
method.append(mirrorUbootFile, "replace");
- auto result = bus.call(method);
- // Check that the bus call didn't result in an error
- if (result.is_method_error())
+ try
+ {
+ bus.call_noreply(method);
+ }
+ catch (const SdBusError& e)
{
log<level::ERR>("Failed to copy U-Boot to alternate chip");
}
OpenPOWER on IntegriCloud