catch exceptions as const
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Change-Id: Id5a06698ddd6f91510a34aaf9df535bd34c099c0
diff --git a/gen_serialization.mako.hpp b/gen_serialization.mako.hpp
index b4d9568..df29dd4 100644
--- a/gen_serialization.mako.hpp
+++ b/gen_serialization.mako.hpp
@@ -63,7 +63,7 @@
{
a(${t});
}
- catch (Exception &e)
+ catch (const Exception &e)
{
// Ignore any exceptions, property value stays default
}
diff --git a/serialize.hpp b/serialize.hpp
index 32648e2..4bae397 100644
--- a/serialize.hpp
+++ b/serialize.hpp
@@ -86,7 +86,7 @@
iarchive(object);
}
}
- catch (cereal::Exception& e)
+ catch (const cereal::Exception& e)
{
phosphor::logging::log<phosphor::logging::level::ERR>(e.what());
fs::remove(p);
diff --git a/test/associations_test.cpp b/test/associations_test.cpp
index 7da4a20..5fa95c3 100644
--- a/test/associations_test.cpp
+++ b/test/associations_test.cpp
@@ -177,7 +177,7 @@
Manager m{bus};
EXPECT_TRUE(false);
}
- catch (std::exception& e)
+ catch (const std::exception& e)
{}
}
@@ -249,7 +249,7 @@
EXPECT_TRUE(false);
}
- catch (std::exception& e)
+ catch (const std::exception& e)
{}
}
@@ -263,7 +263,7 @@
EXPECT_TRUE(false);
}
- catch (std::exception& e)
+ catch (const std::exception& e)
{}
}
@@ -277,7 +277,7 @@
EXPECT_TRUE(false);
}
- catch (std::exception& e)
+ catch (const std::exception& e)
{}
}
@@ -291,6 +291,6 @@
EXPECT_TRUE(false);
}
- catch (std::exception& e)
+ catch (const std::exception& e)
{}
}