diff options
| -rw-r--r-- | CHANGELOG.md | 3 | ||||
| -rw-r--r-- | src/zenhttp/httpasio.cpp | 3 |
2 files changed, 6 insertions, 0 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index afdf09bc9..cd679adc5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,7 @@ ## +- Bugfix: Improve error handling when processing requests in http asio + +## 0.2.11 - Feature: Gracefully exit if Ctrl-C is pressed - Feature: Structured cache now writes an activity log to `logs/z$` which may be used to understand client interactions better. Enabled by default for the time being - Bugfix: Return error code on exit as set by application diff --git a/src/zenhttp/httpasio.cpp b/src/zenhttp/httpasio.cpp index 7149caf28..0056103cd 100644 --- a/src/zenhttp/httpasio.cpp +++ b/src/zenhttp/httpasio.cpp @@ -543,6 +543,9 @@ HttpServerConnection::HandleRequest() { ZEN_ERROR("Caught exception while handling request: '{}'", ex.what()); + // Drop any partially formatted response + Request.m_Response.reset(); + Request.WriteResponse(HttpResponseCode::InternalServerError, HttpContentType::kText, ex.what()); } } |