diff options
| author | Martin Ridgers <[email protected]> | 2021-12-08 09:10:20 +0100 |
|---|---|---|
| committer | Martin Ridgers <[email protected]> | 2021-12-08 09:10:20 +0100 |
| commit | 3655347983570f17ecb1b0374f8a79501c0f870e (patch) | |
| tree | c6b9c52c403e6a1ceeb76f05a38f88375459bf47 /zenhttp/httpasio.cpp | |
| parent | Merged main (diff) | |
| parent | Return status_code as ErrorCode from jupiter api if not successful (diff) | |
| download | zen-3655347983570f17ecb1b0374f8a79501c0f870e.tar.xz zen-3655347983570f17ecb1b0374f8a79501c0f870e.zip | |
Merged main
Diffstat (limited to 'zenhttp/httpasio.cpp')
| -rw-r--r-- | zenhttp/httpasio.cpp | 12 |
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)) |