catch exceptions as const
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Change-Id: Ia8f2ae95679f98f2fc3f32239bbf3b3578c35888
diff --git a/procedures/phal/check_host_running.cpp b/procedures/phal/check_host_running.cpp
index 2ae3fba..d096193 100644
--- a/procedures/phal/check_host_running.cpp
+++ b/procedures/phal/check_host_running.cpp
@@ -42,7 +42,7 @@
{
phal_init();
}
- catch (std::exception& ex)
+ catch (const std::exception& ex)
{
// This should "never" happen so just throw the exception and let
// our systemd error handling process this
@@ -119,7 +119,7 @@
{
phal_init();
}
- catch (std::exception& ex)
+ catch (const std::exception& ex)
{
// This should "never" happen so just throw the exception and let
// our systemd error handling process this
diff --git a/procedures/phal/import_devtree.cpp b/procedures/phal/import_devtree.cpp
index 6d8adc4..d1cff3e 100644
--- a/procedures/phal/import_devtree.cpp
+++ b/procedures/phal/import_devtree.cpp
@@ -82,7 +82,7 @@
fs::remove_all(path);
}
}
- catch (fs::filesystem_error& e)
+ catch (const fs::filesystem_error& e)
{ // Log message and continue. Data already applied successfully.
log<level::ERR>(fmt::format("File({}) delete failed Error:({})",
DEVTREE_EXP_FILE, e.what())
diff --git a/procedures/phal/start_host.cpp b/procedures/phal/start_host.cpp
index 12eddc3..37a14ef 100644
--- a/procedures/phal/start_host.cpp
+++ b/procedures/phal/start_host.cpp
@@ -179,7 +179,7 @@
phal_init();
ipl_set_type(iplType);
}
- catch (std::exception& ex)
+ catch (const std::exception& ex)
{
log<level::ERR>("Exception raised during init PHAL",
entry("EXCEPTION=%s", ex.what()));