Move dbus method call into try-catch block

This change is to avoid networkd core dumping in systems
where resolved service is not active. Moving the dbus
call into try block will throw the exception instead of
networkd core dump.

Signed-off-by: Asmitha Karunanithi <asmitk01@in.ibm.com>
Change-Id: I547fcb910628fa20312099caa97fa0f76b6d140f
diff --git a/src/ethernet_interface.cpp b/src/ethernet_interface.cpp
index 4c31383..ff5a21b 100644
--- a/src/ethernet_interface.cpp
+++ b/src/ethernet_interface.cpp
@@ -837,10 +837,10 @@
                                       PROPERTY_INTERFACE, METHOD_GET);
 
     method.append(RESOLVED_INTERFACE, "DNS");
-    auto reply = bus.call(method);
 
     try
     {
+        auto reply = bus.call(method);
         reply.read(name);
     }
     catch (const sdbusplus::exception_t& e)