catch exceptions as const
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Change-Id: Ia8f2ae95679f98f2fc3f32239bbf3b3578c35888
diff --git a/extensions/phal/create_pel.cpp b/extensions/phal/create_pel.cpp
index c10f32c..b1557e7 100644
--- a/extensions/phal/create_pel.cpp
+++ b/extensions/phal/create_pel.cpp
@@ -80,7 +80,7 @@
throw std::runtime_error(
"Error in invoking D-Bus logging create interface");
}
- catch (std::exception& e)
+ catch (const std::exception& e)
{
throw e;
}
@@ -138,7 +138,7 @@
throw std::runtime_error(
"Error in invoking D-Bus logging create interface");
}
- catch (std::exception& e)
+ catch (const std::exception& e)
{
throw e;
}
@@ -180,7 +180,7 @@
throw std::runtime_error(
"Error in invoking D-Bus logging create interface");
}
- catch (std::exception& e)
+ catch (const std::exception& e)
{
log<level::ERR>(
fmt::format("D-bus call exception", "EXCEPTION={}", e.what())
diff --git a/extensions/phal/devtree_export.cpp b/extensions/phal/devtree_export.cpp
index 922c341..ad21332 100644
--- a/extensions/phal/devtree_export.cpp
+++ b/extensions/phal/devtree_export.cpp
@@ -23,7 +23,7 @@
// Watch for software update
eventRet = event.loop();
}
- catch (std::exception& e)
+ catch (const std::exception& e)
{
using namespace phosphor::logging;
log<level::ERR>(
diff --git a/extensions/phal/fw_update_watch.cpp b/extensions/phal/fw_update_watch.cpp
index 2c6f813..b778734 100644
--- a/extensions/phal/fw_update_watch.cpp
+++ b/extensions/phal/fw_update_watch.cpp
@@ -91,7 +91,7 @@
// Colect device tree data
openpower::phal::fwupdate::exportDevtree();
}
- catch (fs::filesystem_error& e)
+ catch (const fs::filesystem_error& e)
{
log<level::ERR>(
fmt::format("Filesystem error reported Error:({})", e.what())
diff --git a/extensions/phal/phal_error.cpp b/extensions/phal/phal_error.cpp
index d769d11..b6dc1d7 100644
--- a/extensions/phal/phal_error.cpp
+++ b/extensions/phal/phal_error.cpp
@@ -492,7 +492,7 @@
openpower::pel::createBootErrorPEL(pelAdditionalData,
jsonCalloutDataList);
}
- catch (std::exception& ex)
+ catch (const std::exception& ex)
{
reset();
throw ex;
@@ -595,7 +595,7 @@
logLevel = std::stoi(env_p);
}
}
- catch (std::exception& e)
+ catch (const std::exception& e)
{
log<level::ERR>(("Conversion Failure"), entry("ENVIRONMENT=%s", env),
entry("EXCEPTION=%s", e.what()));