summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEd Tanous <ed.tanous@intel.com>2018-08-10 12:51:53 -0700
committerEd Tanous <ed.tanous@intel.com>2018-08-10 13:02:35 -0700
commit87c781732247086a56d8f8cb4360c6eb4863f658 (patch)
treee072930398af2b44a12259c5ee807e9996617502
parentdd691576c829350dd9718909be6a36de70a42e27 (diff)
downloadphosphor-bmc-code-mgmt-87c781732247086a56d8f8cb4360c6eb4863f658.tar.gz
phosphor-bmc-code-mgmt-87c781732247086a56d8f8cb4360c6eb4863f658.zip
Catch SdBusError when calling the mapper
In certain cases, the mapper may return a not found error when polling for BMC endpoints. While this is an error, it should not crash phosphor-software-manager. Tested By: Booted the system without a bmc interface present, and verified that software manager doesn't crash Change-Id: I1199d6f94deb6cf5a795f8770d9dac202697f401 Signed-off-by: Ed Tanous <ed.tanous@intel.com>
-rw-r--r--item_updater.cpp23
1 files changed, 13 insertions, 10 deletions
diff --git a/item_updater.cpp b/item_updater.cpp
index 22734ef..e2d0f94 100644
--- a/item_updater.cpp
+++ b/item_updater.cpp
@@ -464,20 +464,23 @@ void ItemUpdater::setBMCInventoryPath()
std::vector<std::string> filter = {BMC_INVENTORY_INTERFACE};
mapperCall.append(filter);
- auto response = bus.call(mapperCall);
- if (response.is_method_error())
+ try
{
- log<level::ERR>("Error in mapper GetSubTreePath");
- return;
- }
+ auto response = bus.call(mapperCall);
- using ObjectPaths = std::vector<std::string>;
- ObjectPaths result;
- response.read(result);
+ using ObjectPaths = std::vector<std::string>;
+ ObjectPaths result;
+ response.read(result);
- if (!result.empty())
+ if (!result.empty())
+ {
+ bmcInventoryPath = result.front();
+ }
+ }
+ catch (const sdbusplus::exception::SdBusError& e)
{
- bmcInventoryPath = result.front();
+ log<level::ERR>("Error in mapper GetSubTreePath");
+ return;
}
return;
OpenPOWER on IntegriCloud