summaryrefslogtreecommitdiff
path: root/http/routing.hpp
diff options
context:
space:
mode:
authorEd Tanous <edtanous@google.com>2023-03-10 20:57:18 +0300
committerEd Tanous <ed@tanous.net>2023-03-15 00:23:02 +0300
commit4f10f7e3f7c8b3d67803f691d3a0b394b9bccfc1 (patch)
tree17a8e079d6cb1305f55c31f729de9e9df04f24d3 /http/routing.hpp
parent3d1832037ed42ffdbb1dfea4a440d5d7233c6b55 (diff)
downloadbmcweb-4f10f7e3f7c8b3d67803f691d3a0b394b9bccfc1.tar.xz
Remove try-catch blocks on handleUpgrade
handleUpgrade is pretty simple, and has no methods that can throw. This was there previously because of handling exceptions in handle() and was copied to handleUpgrade(), even though it doesn't make a ton of sense to do so, given the throw conditions don't really exist, and start() doesn't call path handlers directly anymore. Tested: Code compiles. Only affects error conditions. Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: Iedd7e42b7e908282ab2c2d698e9f6c815b88e857
Diffstat (limited to 'http/routing.hpp')
-rw-r--r--http/routing.hpp24
1 files changed, 2 insertions, 22 deletions
diff --git a/http/routing.hpp b/http/routing.hpp
index d35e4b45a9..40218fbf68 100644
--- a/http/routing.hpp
+++ b/http/routing.hpp
@@ -1388,28 +1388,8 @@ class Router
<< "' " << static_cast<uint32_t>(*verb) << " / "
<< rules[ruleIndex]->getMethods();
- // any uncaught exceptions become 500s
- try
- {
- rules[ruleIndex]->handleUpgrade(req, asyncResp,
- std::forward<Adaptor>(adaptor));
- }
- catch (const std::exception& e)
- {
- BMCWEB_LOG_ERROR << "An uncaught exception occurred: " << e.what();
- asyncResp->res.result(
- boost::beast::http::status::internal_server_error);
- return;
- }
- catch (...)
- {
- BMCWEB_LOG_ERROR
- << "An uncaught exception occurred. The type was unknown "
- "so no information was available.";
- asyncResp->res.result(
- boost::beast::http::status::internal_server_error);
- return;
- }
+ rules[ruleIndex]->handleUpgrade(req, asyncResp,
+ std::forward<Adaptor>(adaptor));
}
void handle(Request& req,