catch exceptions as const
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Change-Id: Icea9b76115b6c3c7856574605ead3fedc0eca5d6
diff --git a/dbus/dbusconfiguration.cpp b/dbus/dbusconfiguration.cpp
index 8e69455..e9a7991 100644
--- a/dbus/dbusconfiguration.cpp
+++ b/dbus/dbusconfiguration.cpp
@@ -98,7 +98,7 @@
auto resp = bus.call(mapper);
resp.read(respData);
}
- catch (sdbusplus::exception_t&)
+ catch (const sdbusplus::exception_t&)
{
// can't do anything without mapper call data
throw std::runtime_error("ObjectMapper Call Failure");
@@ -129,7 +129,7 @@
auto resp = bus.call(getProfile);
resp.read(variantResp);
}
- catch (sdbusplus::exception_t&)
+ catch (const sdbusplus::exception_t&)
{
throw std::runtime_error("Failure getting profile");
}
@@ -376,7 +376,7 @@
auto resp = bus.call(mapper);
resp.read(respData);
}
- catch (sdbusplus::exception_t&)
+ catch (const sdbusplus::exception_t&)
{
// can't do anything without mapper call data
throw std::runtime_error("ObjectMapper Call Failure");
@@ -440,7 +440,7 @@
auto responce = bus.call(endpoint);
responce.read(configuration);
}
- catch (sdbusplus::exception_t&)
+ catch (const sdbusplus::exception_t&)
{
// this shouldn't happen, probably means daemon crashed
throw std::runtime_error("Error getting managed objects from " +
diff --git a/dbus/dbushelper.cpp b/dbus/dbushelper.cpp
index a192fa2..0e4ba67 100644
--- a/dbus/dbushelper.cpp
+++ b/dbus/dbushelper.cpp
@@ -147,7 +147,7 @@
auto msg = _bus.call(critical);
msg.read(criticalMap);
}
- catch (sdbusplus::exception_t&)
+ catch (const sdbusplus::exception_t&)
{
// do nothing, sensors don't have to expose critical thresholds
return false;
diff --git a/dbus/dbuspassiveredundancy.cpp b/dbus/dbuspassiveredundancy.cpp
index 2ca8fde..57c3c50 100644
--- a/dbus/dbuspassiveredundancy.cpp
+++ b/dbus/dbuspassiveredundancy.cpp
@@ -59,7 +59,7 @@
{
message.read(objectName, result);
}
- catch (sdbusplus::exception_t&)
+ catch (const sdbusplus::exception_t&)
{
std::cerr << "Error reading match data";
return;
@@ -82,7 +82,7 @@
auto reply = passiveBus.call(methodCall);
reply.read(collection);
}
- catch (sdbusplus::exception_t&)
+ catch (const sdbusplus::exception_t&)
{
std::cerr << "Error reading match data";
return;
@@ -121,7 +121,7 @@
auto resp = passiveBus.call(mapper);
resp.read(respData);
}
- catch (sdbusplus::exception_t&)
+ catch (const sdbusplus::exception_t&)
{
std::cerr << "Populate Failures Mapper Error\n";
return;
@@ -156,7 +156,7 @@
auto data = passiveBus.call(call);
data.read(getAll);
}
- catch (sdbusplus::exception_t&)
+ catch (const sdbusplus::exception_t&)
{
std::cerr << "Populate Failures Mapper Error\n";
return;