cleanup: drop obsolete is_method_error checks

is_method_error is obsolete from sdbusplus.

Change-Id: Ia3fb76dd2f4a14eca51b3cfbcd50427b36d946b3
Signed-off-by: Patrick Venture <venture@google.com>
diff --git a/setsensor.cpp b/setsensor.cpp
index a60778f..3681996 100644
--- a/setsensor.cpp
+++ b/setsensor.cpp
@@ -36,15 +36,15 @@
     pimMsg.append(sproperty);
     pimMsg.append(v);
 
-    auto responseMsg = PropertyWriteBus.call(pimMsg);
-    if (responseMsg.is_method_error())
+    try
+    {
+        auto responseMsg = PropertyWriteBus.call(pimMsg);
+        fprintf(stderr, "call to Set the host sensor value succeeded.\n");
+    }
+    catch (const sdbusplus::exception::SdBusError& ex)
     {
         fprintf(stderr, "call to Set the host sensor value failed.\n");
     }
-    else
-    {
-        fprintf(stderr, "call to Set the host sensor value succeeded.\n");
-    }
 }
 
 static std::string GetControlPath(int8_t zone)
@@ -69,15 +69,15 @@
     pimMsg.append(property);
     pimMsg.append(v);
 
-    auto responseMsg = PropertyWriteBus.call(pimMsg);
-    if (responseMsg.is_method_error())
+    try
+    {
+        auto responseMsg = PropertyWriteBus.call(pimMsg);
+        fprintf(stderr, "call to Set the manual mode succeeded.\n");
+    }
+    catch (const sdbusplus::exception::SdBusError& ex)
     {
         fprintf(stderr, "call to Set the manual mode failed.\n");
     }
-    else
-    {
-        fprintf(stderr, "call to Set the manual mode succeeded.\n");
-    }
 }
 
 int main(int argc, char* argv[])