| commit | 28f013a17b5651361cc40f0838aaf00751398aa6 | [log] [tgz] |
|---|---|---|
| author | George Liu <liuxiwei@ieisystem.com> | Tue Nov 04 16:39:11 2025 +0800 |
| committer | George Liu <liuxiwei@ieisystem.com> | Tue Nov 04 16:43:14 2025 +0800 |
| tree | ce216fb9db80f4bb81499468d8587c10b1f77962 | |
| parent | e7f6cd96600e7b40d990d9a991688d45ecac9901 [diff] |
Remove is_method_error method Remove the usage of is_method_error()[1], and add try-catch to handle D-Bus exceptions around mapper call. [1]: https://github.com/openbmc/sdbusplus/commit/079fb85a398d90800935e3985bb1266a7530a26e#diff-945669e8bd9cab4ecc83a574a732921281b2c79eb8bba65efff11736ad18f92bR237-R240 Change-Id: I46c8b7adf460acd15d22e627536733385a58715f Signed-off-by: George Liu <liuxiwei@ieisystem.com>
diff --git a/fault-monitor/fru-fault-monitor.cpp b/fault-monitor/fru-fault-monitor.cpp index 7b323b2..7ce8cca 100644 --- a/fault-monitor/fru-fault-monitor.cpp +++ b/fault-monitor/fru-fault-monitor.cpp
@@ -218,17 +218,11 @@ "org.freedesktop.DBus.Properties", "Get"); method.append("xyz.openbmc_project.Association.Definitions"); method.append("Associations"); - auto reply = bus.call(method); - if (reply.is_method_error()) - { - // do not stop, continue with next elog - lg2::error("Error in getting associations"); - continue; - } std::variant<AssociationList> assoc; try { + auto reply = bus.call(method); reply.read(assoc); } catch (const sdbusplus::exception_t& e)