catch exceptions as const
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Change-Id: Ic2b49715c7b81ac5bcfc12ff2d3b4c593cd95ce7
diff --git a/chassishandler.cpp b/chassishandler.cpp
index dfbe004..30ffb23 100644
--- a/chassishandler.cpp
+++ b/chassishandler.cpp
@@ -277,7 +277,7 @@
reinterpret_cast<void*>(gatewayDetails.data()));
payload.pack(gatewayDetails);
}
- catch (InternalFailure& e)
+ catch (const InternalFailure& e)
{
commit<InternalFailure>();
rc = -1;
@@ -552,7 +552,7 @@
log<level::DEBUG>("Network configuration changed",
entry("NETWORKCONFIG=%s", hostNetworkConfig.c_str()));
}
- catch (sdbusplus::exception_t& e)
+ catch (const sdbusplus::exception_t& e)
{
commit<InternalFailure>();
log<level::ERR>("Error in ipmiChassisSetSysBootOptions call");
@@ -626,7 +626,7 @@
ipmi::getAllDbusProperties(bus, chassisCapObject.second,
chassisCapObject.first, chassisCapIntf);
}
- catch (std::exception& e)
+ catch (const std::exception& e)
{
log<level::ERR>("Failed to fetch Chassis Capability properties",
entry("ERROR=%s", e.what()));
@@ -804,7 +804,7 @@
chassisCapObject.first, chassisCapIntf,
chassisBridgeDevAddrProp, bridgeDeviceAddr);
}
- catch (std::exception& e)
+ catch (const std::exception& e)
{
log<level::ERR>(e.what());
return ipmi::responseUnspecifiedError();
@@ -892,7 +892,7 @@
ipmi::setDbusProperty(*busp, service, nmiSourceObjPath, nmiSourceIntf,
"Enabled", value);
}
- catch (std::exception& e)
+ catch (const std::exception& e)
{
log<level::ERR>("Failed to trigger NMI_OUT",
entry("EXCEPTION=%s", e.what()));
@@ -1046,7 +1046,7 @@
buttonIntf, "Enabled");
buttonDisabled = !std::get<bool>(enabled);
}
- catch (sdbusplus::exception::exception& e)
+ catch (const sdbusplus::exception::exception& e)
{
log<level::ERR>("Fail to get button Enabled property",
entry("PATH=%s", buttonPath.c_str()),
@@ -2039,7 +2039,7 @@
uint2_t{}, uint8_t{}, uint8_t{}, uint8_t{});
return ipmi::responseSuccess(std::move(response));
}
- catch (InternalFailure& e)
+ catch (const InternalFailure& e)
{
cache::objectsPtr.reset();
report<InternalFailure>();
@@ -2237,7 +2237,7 @@
return ipmi::responseInvalidFieldRequest();
}
}
- catch (sdbusplus::exception_t& e)
+ catch (const sdbusplus::exception_t& e)
{
objectsPtr.reset();
report<InternalFailure>();
@@ -2345,7 +2345,7 @@
return ipmi::responseSuccess(static_cast<uint8_t>(poh::minutesPerCount),
getPOHCounter());
}
- catch (std::exception& e)
+ catch (const std::exception& e)
{
log<level::ERR>(e.what());
return ipmi::responseUnspecifiedError();
@@ -2408,7 +2408,7 @@
return ipmi::responseUnspecifiedError();
}
}
- catch (InternalFailure& e)
+ catch (const InternalFailure& e)
{
chassis::internal::cache::objectsPtr.reset();
report<InternalFailure>();