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.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Change-Id: Iac59331eb31ef7b4c31f21ce4463c6bc7cf83e56
diff --git a/util.cpp b/util.cpp
index 492e954..db104bf 100644
--- a/util.cpp
+++ b/util.cpp
@@ -106,8 +106,11 @@
auto method = bus.new_method_call(SYSTEMD_BUSNAME, SYSTEMD_PATH,
SYSTEMD_INTERFACE, "KillUnit");
method.append(JOURNAL_UNIT, "main", signal);
- bus.call(method);
- if (method.is_method_error())
+ try
+ {
+ bus.call(method);
+ }
+ catch (sdbusplus::exception_t&)
{
lg2::error("Failed to kill journal service");
break;