aboutsummaryrefslogtreecommitdiff
path: root/zenhttp/httpasio.cpp
diff options
context:
space:
mode:
authorMartin Ridgers <[email protected]>2021-12-08 09:10:20 +0100
committerMartin Ridgers <[email protected]>2021-12-08 09:10:20 +0100
commit3655347983570f17ecb1b0374f8a79501c0f870e (patch)
treec6b9c52c403e6a1ceeb76f05a38f88375459bf47 /zenhttp/httpasio.cpp
parentMerged main (diff)
parentReturn status_code as ErrorCode from jupiter api if not successful (diff)
downloadzen-3655347983570f17ecb1b0374f8a79501c0f870e.tar.xz
zen-3655347983570f17ecb1b0374f8a79501c0f870e.zip
Merged main
Diffstat (limited to 'zenhttp/httpasio.cpp')
-rw-r--r--zenhttp/httpasio.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/zenhttp/httpasio.cpp b/zenhttp/httpasio.cpp
index 131c4513f..778a1ead9 100644
--- a/zenhttp/httpasio.cpp
+++ b/zenhttp/httpasio.cpp
@@ -502,7 +502,17 @@ HttpServerConnection::HandleRequest()
if (!HandlePackageOffers(*Service, Request, m_PackageHandler))
{
- Service->HandleRequest(Request);
+ try
+ {
+ Service->HandleRequest(Request);
+ }
+ catch (std::exception& ex)
+ {
+ ZEN_ERROR("Caught exception while handling request: '{}'", ex.what());
+
+ Request.WriteResponse(HttpResponseCode::InternalServerError, HttpContentType::kText, ex.what());
+ }
+
}
if (std::unique_ptr<HttpResponse> Response = std::move(Request.m_Response))