Handle D-Bus exceptions
Remove the usage of is_method_error()[1].
Also, add try-catch to handle D-Bus exceptions around mapper call.
[1]https://github.com/openbmc/sdbusplus/commit/079fb85a398d90800935e3985bb1266a7530a26e#diff-945669e8bd9cab4ecc83a574a732921281b2c79eb8bba65efff11736ad18f92bR237-R240
Signed-off-by: George Liu <liuxiwei@inspur.com>
Change-Id: I85ab0425e441a739966b0a23e46a1974cf67476c
diff --git a/src/resolve_errors.cpp b/src/resolve_errors.cpp
index fd5be34..a5fd917 100644
--- a/src/resolve_errors.cpp
+++ b/src/resolve_errors.cpp
@@ -90,16 +90,8 @@
std::variant<bool> resolved = true;
- auto response =
- SDBusPlus::callMethod(busName, logEntry, PROPERTY_IFACE, "Set",
- LOGGING_IFACE, RESOLVED_PROPERTY, resolved);
-
- if (response.is_method_error())
- {
- lg2::error(
- "Failed to set Resolved property on an error log entry: {ENTRY}",
- "ENTRY", logEntry);
- }
+ SDBusPlus::callMethod(busName, logEntry, PROPERTY_IFACE, "Set",
+ LOGGING_IFACE, RESOLVED_PROPERTY, resolved);
}
catch (const std::exception& e)
{