break;
}
}
- } catch (TTransportException& ttx) {
- cerr << "TNonblockingServer client died: " << ttx.what() << endl;
- } catch (TException& x) {
- cerr << "TNonblockingServer exception: " << x.what() << endl;
- } catch (bad_alloc&) {
- cerr << "TNonblockingServer caught bad_alloc exception.";
+ } catch (const TTransportException& ttx) {
+ GlobalOutput.printf("TNonblockingServer client died: %s", ttx.what());
+ } catch (const bad_alloc&) {
+ GlobalOutput("TNonblockingServer caught bad_alloc exception.");
exit(-1);
+ } catch (const std::exception& x) {
+ GlobalOutput.printf("TNonblockingServer process() exception: %s: %s",
+ typeid(x).name(), x.what());
} catch (...) {
- cerr << "TNonblockingServer uncaught exception." << endl;
+ GlobalOutput("TNonblockingServer uncaught exception.");
}
// Signal completion back to the libevent thread via a pipe
try {
// Invoke the processor
server_->getProcessor()->process(inputProtocol_, outputProtocol_, NULL);
- } catch (TTransportException &ttx) {
- GlobalOutput.printf("TTransportException: Server::process() %s", ttx.what());
+ } catch (const TTransportException &ttx) {
+ GlobalOutput.printf("TNonblockingServer transport error in "
+ "process(): %s", ttx.what());
server_->decrementActiveProcessors();
close();
return;
- } catch (TException &x) {
- GlobalOutput.printf("TException: Server::process() %s", x.what());
+ } catch (const std::exception &x) {
+ GlobalOutput.printf("Server::process() uncaught exception: %s: %s",
+ typeid(x).name(), x.what());
server_->decrementActiveProcessors();
close();
return;
break;
}
}
- } catch (TTransportException& ttx) {
+ } catch (const TTransportException& ttx) {
string errStr = string("TSimpleServer client died: ") + ttx.what();
GlobalOutput(errStr.c_str());
- } catch (TException& tx) {
- string errStr = string("TSimpleServer exception: ") + tx.what();
- GlobalOutput(errStr.c_str());
+ } catch (const std::exception& x) {
+ GlobalOutput.printf("TSimpleServer exception: %s: %s",
+ typeid(x).name(), x.what());
} catch (...) {
GlobalOutput("TSimpleServer uncaught exception.");
}
break;
}
}
- } catch (TTransportException& ttx) {
+ } catch (const TTransportException& ttx) {
// This is reasonably expected, client didn't send a full request so just
// ignore him
// string errStr = string("TThreadPoolServer client died: ") + ttx.what();
// GlobalOutput(errStr.c_str());
- } catch (TException& x) {
- string errStr = string("TThreadPoolServer exception: ") + x.what();
- GlobalOutput(errStr.c_str());
- } catch (std::exception &x) {
- string errStr = string("TThreadPoolServer, std::exception: ") + x.what();
- GlobalOutput(errStr.c_str());
+ } catch (const std::exception& x) {
+ GlobalOutput.printf("TThreadPoolServer exception %s: %s",
+ typeid(x).name(), x.what());
} catch (...) {
GlobalOutput("TThreadPoolServer, unexpected exception in "
"TThreadPoolServer::Task::run()");
break;
}
}
- } catch (TTransportException& ttx) {
+ } catch (const TTransportException& ttx) {
if (ttx.getType() != TTransportException::END_OF_FILE) {
string errStr = string("TThreadedServer client died: ") + ttx.what();
GlobalOutput(errStr.c_str());
}
- } catch (TException& x) {
- string errStr = string("TThreadedServer exception: ") + x.what();
- GlobalOutput(errStr.c_str());
+ } catch (const std::exception &x) {
+ GlobalOutput.printf("TThreadedServer exception: %s: %s",
+ typeid(x).name(), x.what());
} catch (...) {
GlobalOutput("TThreadedServer uncaught exception.");
}