catch exceptions as const
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Change-Id: If6aba71f482f75143e6d669763b8853db22318cf
diff --git a/power-supply/power_supply.cpp b/power-supply/power_supply.cpp
index be89ed3..548895d 100644
--- a/power-supply/power_supply.cpp
+++ b/power-supply/power_supply.cpp
@@ -78,7 +78,7 @@
std::string(PowerSupplyInputFault::errName));
}
}
- catch (ReadFailure& e)
+ catch (const ReadFailure& e)
{
log<level::INFO>("Unable to read the 2 byte STATUS_WORD value to check "
"for power-supply input faults.");
@@ -122,7 +122,7 @@
auto val = pmbusIntf.read(cmd, type);
nv.add(cmd, val);
}
- catch (std::exception& e)
+ catch (const std::exception& e)
{
log<level::INFO>("Unable to capture metadata",
entry("CMD=%s", cmd.c_str()));
@@ -158,7 +158,7 @@
updateHistory();
}
}
- catch (ReadFailure& e)
+ catch (const ReadFailure& e)
{
if (readFail < FAULT_COUNT)
{
@@ -597,7 +597,7 @@
}
}
}
- catch (std::exception& e)
+ catch (const std::exception& e)
{
log<level::INFO>("Failed to resolve error",
entry("CALLOUT=%s", callout.c_str()),
@@ -637,7 +637,7 @@
inventoryPMBusAccessType)
: "");
}
- catch (ReadFailure& e)
+ catch (const ReadFailure& e)
{}
}
}
@@ -670,7 +670,7 @@
auto reply = bus.call(method);
}
- catch (std::exception& e)
+ catch (const std::exception& e)
{
log<level::ERR>(e.what(), entry("PATH=%s", inventoryPath.c_str()));
}
@@ -699,7 +699,7 @@
recordManager->clear();
}
- catch (std::exception& e)
+ catch (const std::exception& e)
{
// Do nothing. There would already be a journal entry.
}