Reduce journal logs

Presently the code was creating the elog during reading of
the values from the config parser which creates
the journal log internally("Internal error Occured")

Apart from creating elog,Code also logs into the journal
more descriptive message saying which section and key
was not found.

The code which catches the exception that also logs
into the journal.

In the changed approach instead of throwing exception
we are returning the return code as not finding a section
or key in the network config file is not an error.

Change-Id: Ib89a3af6541fdf93fb5fa9a8e583d6c6ed88da79
Signed-off-by: Ratan Gupta <ratagupt@in.ibm.com>
diff --git a/ethernet_interface.cpp b/ethernet_interface.cpp
index 15f40fb..7d13c1c 100644
--- a/ethernet_interface.cpp
+++ b/ethernet_interface.cpp
@@ -398,14 +398,14 @@
                            systemd::config::networkFileSuffix;
     confPath /= fileName;
     ServerList servers;
-    try
+    config::Parser parser(confPath.string());
+    auto rc = config::ReturnCode::SUCCESS;
+
+    std::tie(rc, servers) = parser.getValues("Network", "DNS");
+    if (rc != config::ReturnCode::SUCCESS)
     {
-        config::Parser parser(confPath.string());
-        servers = parser.getValues("Network", "DNS");
-    }
-    catch (InternalFailure& e)
-    {
-        log<level::INFO>("Exception getting DNS value from conf file");
+        log<level::DEBUG>("Unable to get the value for network[DNS]",
+                          entry("RC=%d", rc));
     }
     return servers;
 }
@@ -484,18 +484,20 @@
     fs::path confPath = manager.getConfDir();
 
     std::string fileName = systemd::config::networkFilePrefix + interfaceName() +
-                           systemd::config::networkFileSuffix;
+        systemd::config::networkFileSuffix;
     confPath /= fileName;
+
     ServerList servers;
-    try
+    config::Parser parser(confPath.string());
+    auto rc = config::ReturnCode::SUCCESS;
+
+    std::tie(rc, servers) = parser.getValues("Network", "NTP");
+    if (rc != config::ReturnCode::SUCCESS)
     {
-        config::Parser parser(confPath.string());
-        servers = parser.getValues("Network", "NTP");
+        log<level::DEBUG>("Unable to get the value for Network[NTP]",
+                          entry("rc=%d", rc));
     }
-    catch (InternalFailure& e)
-    {
-        log<level::INFO>("Unable to find the NTP server configuration.");
-    }
+
     return servers;
 }