ethernet_interface: Remove unused try blocks
This makes the error handling more consistent with the rest of the
callers in the file. We don't need to handle exceptions from our reload
/ writer functions.
Change-Id: Iee2b61c8282e4b466327f85bedd2acf2634f42b6
Signed-off-by: William A. Kennington III <wak@google.com>
diff --git a/src/ethernet_interface.cpp b/src/ethernet_interface.cpp
index a273934..a2d123d 100644
--- a/src/ethernet_interface.cpp
+++ b/src/ethernet_interface.cpp
@@ -444,18 +444,13 @@
Argument::ARGUMENT_VALUE(ip.c_str()));
}
}
- try
- {
- EthernetInterfaceIntf::staticNameServers(value);
- writeConfigurationFile();
- manager.get().reloadConfigs();
- }
- catch (const InternalFailure& e)
- {
- lg2::error("Exception processing DNS entries: {ERROR}", "ERROR", e);
- }
- return EthernetInterfaceIntf::staticNameServers();
+ value = EthernetInterfaceIntf::staticNameServers(std::move(value));
+
+ writeConfigurationFile();
+ manager.get().reloadConfigs();
+
+ return value;
}
void EthernetInterface::loadNTPServers(const config::Parser& config)
@@ -602,18 +597,12 @@
ServerList EthernetInterface::staticNTPServers(ServerList value)
{
- try
- {
- EthernetInterfaceIntf::staticNTPServers(value);
+ value = EthernetInterfaceIntf::staticNTPServers(std::move(value));
- writeConfigurationFile();
- manager.get().reloadConfigs();
- }
- catch (InternalFailure& e)
- {
- lg2::error("Exception processing NTP entries: {ERROR}", "ERROR", e);
- }
- return EthernetInterfaceIntf::staticNTPServers();
+ writeConfigurationFile();
+ manager.get().reloadConfigs();
+
+ return value;
}
ServerList EthernetInterface::ntpServers(ServerList /*servers*/)