setrlimit causes bad_alloc exceptions, but undefined behavior occurs if
we don't exit. It is not typical for libraries to call exit, but it is
not clear what other behavior is possible.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@920665
13f79535-47bb-0310-9956-
ffa450edef68
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.";
+ exit(-1);
} catch (...) {
cerr << "TNonblockingServer uncaught exception." << endl;
}