diff options
| author | zousar <[email protected]> | 2021-12-02 08:13:42 -0700 |
|---|---|---|
| committer | GitHub <[email protected]> | 2021-12-02 08:13:42 -0700 |
| commit | 7e89dde9d3f0459b5aa3f2236ceb58fc8c8499f8 (patch) | |
| tree | 512d775366031dc7a5b3e551b112d96cf2c5f1ca /zenhttp/httpasio.cpp | |
| parent | Use 'Platform' instead of 'OSFamily' for Horde condition (diff) | |
| parent | Wrap asio call to Service->HandleRequest in try/catch like http.sys. (diff) | |
| download | zen-7e89dde9d3f0459b5aa3f2236ceb58fc8c8499f8.tar.xz zen-7e89dde9d3f0459b5aa3f2236ceb58fc8c8499f8.zip | |
Merge pull request #32 from EpicGames/non-elevated-asio
Wrap asio call to Service->HandleRequest in try/catch like http.sys.
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 9a23a25ef..7ee7193d1 100644 --- a/zenhttp/httpasio.cpp +++ b/zenhttp/httpasio.cpp @@ -500,7 +500,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)) |