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

Signed-off-by: George Liu <liuxiwei@inspur.com>
Change-Id: I85192219c1c34cf5fd6c6aca06a8b207d7e06697
diff --git a/sensordatahandler.cpp b/sensordatahandler.cpp
index e29cfac..93ee714 100644
--- a/sensordatahandler.cpp
+++ b/sensordatahandler.cpp
@@ -41,22 +41,18 @@
     mapperCall.append(depth);
     mapperCall.append(std::vector<Interface>({interface}));
 
-    auto mapperResponseMsg = bus.call(mapperCall);
-    if (mapperResponseMsg.is_method_error())
-    {
-        log<level::ERR>("Mapper GetSubTree failed",
-                        entry("PATH=%s", path.c_str()),
-                        entry("INTERFACE=%s", interface.c_str()));
-        elog<InternalFailure>();
-    }
-
     MapperResponseType mapperResponse;
-    mapperResponseMsg.read(mapperResponse);
-    if (mapperResponse.empty())
+    try
+    {
+        auto mapperResponseMsg = bus.call(mapperCall);
+        mapperResponseMsg.read(mapperResponse);
+    }
+    catch (const std::exception& e)
     {
         log<level::ERR>("Invalid mapper response",
                         entry("PATH=%s", path.c_str()),
-                        entry("INTERFACE=%s", interface.c_str()));
+                        entry("INTERFACE=%s", interface.c_str()),
+                        entry("ERROR=%s", e.what()));
         elog<InternalFailure>();
     }
 
@@ -94,14 +90,10 @@
     try
     {
         auto serviceResponseMsg = bus.call(msg);
-        if (serviceResponseMsg.is_method_error())
-        {
-            log<level::ERR>("Error in D-Bus call");
-            return IPMI_CC_UNSPECIFIED_ERROR;
-        }
     }
     catch (const InternalFailure& e)
     {
+        log<level::ERR>("Error in D-Bus call", entry("ERROR=%s", e.what()));
         commit<InternalFailure>();
         return IPMI_CC_UNSPECIFIED_ERROR;
     }