diff options
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)) |