diff options
-rw-r--r-- | http/routing.hpp | 2 | ||||
-rw-r--r-- | src/crow_test.cpp | 8 |
2 files changed, 5 insertions, 5 deletions
diff --git a/http/routing.hpp b/http/routing.hpp index d2a10b297c..5d9c8e307c 100644 --- a/http/routing.hpp +++ b/http/routing.hpp @@ -1204,7 +1204,7 @@ class Router { rules[ruleIndex]->handleUpgrade(req, res, std::move(adaptor)); } - catch (std::exception& e) + catch (const std::exception& e) { BMCWEB_LOG_ERROR << "An uncaught exception occurred: " << e.what(); res.result(boost::beast::http::status::internal_server_error); diff --git a/src/crow_test.cpp b/src/crow_test.cpp index a6852203a2..0df05d2ad7 100644 --- a/src/crow_test.cpp +++ b/src/crow_test.cpp @@ -58,7 +58,7 @@ TEST(Crow, Rule) r.validate(); fail("empty handler should fail to validate"); } - catch (runtime_error& e) + catch (const runtime_error& e) {} int x = 0; @@ -412,7 +412,7 @@ TEST(Crow, server_handling_error_request) c.receive(asio::buffer(buf, 2048)); fail(); } - catch (std::exception& e) + catch (const std::exception& e) { // std::cerr << e.what() << std::endl; } @@ -891,7 +891,7 @@ TEST(Crow, routeDynamic) app.routeDynamic("/invalid_test/<double>/<path>")([]() { return ""; }); fail(); } - catch (std::exception&) + catch (const std::exception&) {} // app is in an invalid state when routeDynamic throws an exception. @@ -900,7 +900,7 @@ TEST(Crow, routeDynamic) app.validate(); fail(); } - catch (std::exception&) + catch (const std::exception&) {} { |