utils: remove is_method_error call
An `is_method_error` is not appropriate after an sdbus `call` since
`call` will always throw an exception. Remove the pointless call
and instead catch the exception.
Change-Id: I6bd39b96b66c9e1ea8b254bc5b9ebd126b619810
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
diff --git a/utils.cpp b/utils.cpp
index 6498dbd..4025f94 100644
--- a/utils.cpp
+++ b/utils.cpp
@@ -102,18 +102,13 @@
DBUS_PROPERTY_IFACE, "Set");
method.append(interface, propertyName, varValue);
- auto reply = bus.call(method);
- if (reply.is_method_error())
- {
- lg2::error("util::setProperty: Failed to set property {PROP}",
- "PROP", propertyName);
- }
+ bus.call(method);
}
catch (const std::exception& e)
{
auto error = errno;
lg2::error("setProperty: failed to Set {PROP}, errno={ERR}, what={MSG}",
- "PROP", propertyName, "ERR", error, "PROP", e.what());
+ "PROP", propertyName, "ERR", error, "MSG", e);
}
}