Unhandled exception for TEvhttpServer request
---------------------------------------------
Key: THRIFT-1222
URL: https://issues.apache.org/jira/browse/THRIFT-1222
Project: Thrift
Issue Type: Bug
Components: C++ - Library
Affects Versions: 0.6.1, 0.7
Environment: Any
Reporter: alexandre parenteau
Fix For: 0.7
When an error occur during a HTTP request, exceptions are not captured before
entering back libevent. For example a simple 'curl http://localhost:8080' will
trigger a 'not enough data' exception, however no code will actually set the
HTTP status (triggering a unhandled exception, and a crash).
Here is a proposed change:
void TEvhttpServer::request(struct evhttp_request* req, void* self) {
try {
static_cast<TEvhttpServer*>(self)->process(req);
} catch(std::exception& e) {
evhttp_send_reply(req, HTTP_INTERNAL, e.what(), 0);
}
}
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira