0
0
mirror of https://github.com/mongodb/mongo.git synced 2024-12-01 09:32:32 +01:00

catch exceptions in webserver SERVER-551

This commit is contained in:
Eliot Horowitz 2010-01-19 10:01:15 -05:00
parent 036e6f7ba8
commit 069d9e9c3c

View File

@ -153,7 +153,20 @@ namespace mongo {
string responseMsg;
int responseCode = 599;
vector<string> headers;
doRequest(buf, parseURL( buf ), responseMsg, responseCode, headers, from);
try {
doRequest(buf, parseURL( buf ), responseMsg, responseCode, headers, from);
}
catch ( std::exception& e ){
responseCode = 500;
responseMsg = "error loading page: ";
responseMsg += e.what();
}
catch ( std::exception& e ){
responseCode = 500;
responseMsg = "error loading page: ";
responseMsg += e.what();
}
stringstream ss;
ss << "HTTP/1.0 " << responseCode;