aboutsummaryrefslogtreecommitdiff
path: root/src/zenhttp/servers/httpasio.cpp
diff options
context:
space:
mode:
authorEPICGAMES\thierry.begin <[email protected]>2024-04-08 10:43:16 -0400
committerEPICGAMES\thierry.begin <[email protected]>2024-04-08 10:43:16 -0400
commitb35e1258a043cab06950b2453f434861d99b918a (patch)
tree695737774fa08ebaa0e32a9f95cb0247c34b3dc3 /src/zenhttp/servers/httpasio.cpp
parentAdd docker support (diff)
parentMerge pull request #41 from ue-foundation/zs/import-oplog-clean (diff)
downloadzen-tb/docker.tar.xz
zen-tb/docker.zip
Merge branch 'main' of https://github.ol.epicgames.net/ue-foundation/zen into tb/dockertb/docker
Diffstat (limited to 'src/zenhttp/servers/httpasio.cpp')
-rw-r--r--src/zenhttp/servers/httpasio.cpp22
1 files changed, 17 insertions, 5 deletions
diff --git a/src/zenhttp/servers/httpasio.cpp b/src/zenhttp/servers/httpasio.cpp
index de71eb0a7..cddbe1ae2 100644
--- a/src/zenhttp/servers/httpasio.cpp
+++ b/src/zenhttp/servers/httpasio.cpp
@@ -476,7 +476,15 @@ HttpServerConnection::HandleRequest()
{
Service->HandleRequest(Request);
}
- catch (std::system_error& SystemError)
+ catch (const AssertException& AssertEx)
+ {
+ // Drop any partially formatted response
+ Request.m_Response.reset();
+
+ ZEN_ERROR("Caught assert exception while handling request: {}", AssertEx.FullDescription());
+ Request.WriteResponse(HttpResponseCode::InternalServerError, HttpContentType::kText, AssertEx.FullDescription());
+ }
+ catch (const std::system_error& SystemError)
{
// Drop any partially formatted response
Request.m_Response.reset();
@@ -491,14 +499,14 @@ HttpServerConnection::HandleRequest()
Request.WriteResponse(HttpResponseCode::InternalServerError, HttpContentType::kText, SystemError.what());
}
}
- catch (std::bad_alloc& BadAlloc)
+ catch (const std::bad_alloc& BadAlloc)
{
// Drop any partially formatted response
Request.m_Response.reset();
Request.WriteResponse(HttpResponseCode::InsufficientStorage, HttpContentType::kText, BadAlloc.what());
}
- catch (std::exception& ex)
+ catch (const std::exception& ex)
{
// Drop any partially formatted response
Request.m_Response.reset();
@@ -958,7 +966,11 @@ HttpAsioServerImpl::Start(uint16_t Port, bool ForceLooopback, int ThreadCount)
{
m_IoService.run();
}
- catch (std::exception& e)
+ catch (const AssertException& AssertEx)
+ {
+ ZEN_ERROR("Assert caught in asio event loop: {}", AssertEx.FullDescription());
+ }
+ catch (const std::exception& e)
{
ZEN_ERROR("Exception caught in asio event loop: '{}'", e.what());
}
@@ -1075,7 +1087,7 @@ HttpAsioServer::Close()
{
m_Impl->Stop();
}
- catch (std::exception& ex)
+ catch (const std::exception& ex)
{
ZEN_WARN("Caught exception stopping http asio server: {}", ex.what());
}