catch exceptions as const
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Change-Id: I9afd25cfb7f22e4e53a1a58c9a7150c25cfe06b6
diff --git a/src/ethernet_interface.cpp b/src/ethernet_interface.cpp
index 504090f..bdae08f 100644
--- a/src/ethernet_interface.cpp
+++ b/src/ethernet_interface.cpp
@@ -509,7 +509,7 @@
{
deleteInterface(interface);
}
- catch (InternalFailure& e)
+ catch (const InternalFailure& e)
{
commit<InternalFailure>();
}
@@ -812,7 +812,7 @@
// network file.
manager.restartSystemdUnit(networkdService);
}
- catch (InternalFailure& e)
+ catch (const InternalFailure& e)
{
log<level::ERR>("Exception processing DNS entries");
}
@@ -1191,7 +1191,7 @@
{
newMAC = mac_address::fromString(value);
}
- catch (std::invalid_argument&)
+ catch (const std::invalid_argument&)
{
log<level::ERR>("MACAddress is not valid.",
entry("MAC=%s", value.c_str()));
diff --git a/src/network_manager.cpp b/src/network_manager.cpp
index 4ff8952..4ff9e17 100644
--- a/src/network_manager.cpp
+++ b/src/network_manager.cpp
@@ -95,7 +95,7 @@
}
}
}
- catch (std::exception& e)
+ catch (const std::exception& e)
{
log<level::ERR>("Unable to create the default network file");
}
diff --git a/src/routing_table.cpp b/src/routing_table.cpp
index 68a9ee3..ab495eb 100644
--- a/src/routing_table.cpp
+++ b/src/routing_table.cpp
@@ -34,7 +34,7 @@
{
getRoutes();
}
- catch (InternalFailure& e)
+ catch (const InternalFailure& e)
{
commit<InternalFailure>();
}
diff --git a/src/vlan_interface.cpp b/src/vlan_interface.cpp
index 035eb07..2918989 100644
--- a/src/vlan_interface.cpp
+++ b/src/vlan_interface.cpp
@@ -55,7 +55,7 @@
{
stream.open(confPath.c_str(), std::fstream::out);
}
- catch (std::ios_base::failure& e)
+ catch (const std::ios_base::failure& e)
{
log<level::ERR>("Unable to open the VLAN device file",
entry("FILE=%s", confPath.c_str()),