diff options
author | Adriana Kobylak <anoo@us.ibm.com> | 2018-07-18 15:30:39 -0500 |
---|---|---|
committer | Adriana Kobylak <anoo@us.ibm.com> | 2018-07-18 15:35:59 -0500 |
commit | 08d613e7d549d647105bb7ff5a6d3716708d2332 (patch) | |
tree | bae90cc223b8e1a533ff9de1eaa6c818ad7a639c | |
parent | 44bb6683d6dabf9332ddeffe7a63a2a62294b47b (diff) | |
download | phosphor-led-manager-08d613e7d549d647105bb7ff5a6d3716708d2332.tar.gz phosphor-led-manager-08d613e7d549d647105bb7ff5a6d3716708d2332.zip |
Romulus: Handle SdBusError Exceptions
Handle exceptions from the sdbusplus method call_noreply API.
The phosphor-fru-fault-monitor app would fail with the following
message on Romulus with the latest sdbusplus changes:
sd_bus_call noreply: org.freedesktop.DBus.Error.UnknownObject:
Unknown object '/xyz/openbmc_project/led/groups/core1_fault'.
Add error handling.
Tested: The phosphor-fru-fault-monitor does not core dump on Romulus.
Change-Id: I2bec59c0e0f483e8bfc0cb20a343cb05670212b7
Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
-rw-r--r-- | fault-monitor/fru-fault-monitor.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/fault-monitor/fru-fault-monitor.cpp b/fault-monitor/fru-fault-monitor.cpp index 6771b08..158389f 100644 --- a/fault-monitor/fru-fault-monitor.cpp +++ b/fault-monitor/fru-fault-monitor.cpp @@ -138,7 +138,17 @@ void action(sdbusplus::bus::bus& bus, method.append("Asserted"); method.append(sdbusplus::message::variant<bool>(assert)); - bus.call_noreply(method); + + try + { + bus.call_noreply(method); + } + catch (const sdbusplus::exception::SdBusError& e) + { + // Log an info message, system may not have all the LED Groups defined + log<level::INFO>("Failed to Assert LED Group", + entry("ERROR=%s", e.what())); + } return; } |