aboutsummaryrefslogtreecommitdiff
path: root/src/zenhttp/servers/httpplugin.cpp
diff options
context:
space:
mode:
authorDan Engelbrecht <[email protected]>2024-04-04 14:32:40 +0200
committerGitHub Enterprise <[email protected]>2024-04-04 14:32:40 +0200
commit12b7bf1c16f671c83840961c37a339141a7ffbb3 (patch)
tree3c503e6e1cd4d53b87c1baebcf9286ca8b72db06 /src/zenhttp/servers/httpplugin.cpp
parenthardening parsepackagemessage (#38) (diff)
downloadzen-12b7bf1c16f671c83840961c37a339141a7ffbb3.tar.xz
zen-12b7bf1c16f671c83840961c37a339141a7ffbb3.zip
improved assert (#37)
- Improvement: Add file and line to ASSERT exceptions - Improvement: Catch call stack when throwing assert exceptions and log/output call stack at important places to provide more context to caller
Diffstat (limited to 'src/zenhttp/servers/httpplugin.cpp')
-rw-r--r--src/zenhttp/servers/httpplugin.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/zenhttp/servers/httpplugin.cpp b/src/zenhttp/servers/httpplugin.cpp
index 4a2615133..09cd76f3e 100644
--- a/src/zenhttp/servers/httpplugin.cpp
+++ b/src/zenhttp/servers/httpplugin.cpp
@@ -386,7 +386,7 @@ HttpPluginConnectionHandler::HandleRequest()
{
Service->HandleRequest(Request);
}
- catch (std::system_error& SystemError)
+ catch (const std::system_error& SystemError)
{
// Drop any partially formatted response
Request.m_Response.reset();
@@ -401,14 +401,14 @@ HttpPluginConnectionHandler::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();
@@ -691,13 +691,13 @@ HttpPluginServerImpl::Initialize(int BasePort, std::filesystem::path DataDir)
{
Plugin->Initialize(this);
}
- catch (std::exception& Ex)
+ catch (const std::exception& Ex)
{
ZEN_WARN("exception caught during plugin initialization: {}", Ex.what());
}
}
}
- catch (std::exception& ex)
+ catch (const std::exception& ex)
{
ZEN_WARN("Caught exception starting http plugin server: {}", ex.what());
}
@@ -723,7 +723,7 @@ HttpPluginServerImpl::Close()
{
Plugin->Shutdown();
}
- catch (std::exception& Ex)
+ catch (const std::exception& Ex)
{
ZEN_WARN("exception caught during plugin shutdown: {}", Ex.what());
}
@@ -733,7 +733,7 @@ HttpPluginServerImpl::Close()
m_Plugins.clear();
}
- catch (std::exception& ex)
+ catch (const std::exception& ex)
{
ZEN_WARN("Caught exception stopping http plugin server: {}", ex.what());
}