Log uncaught exceptions on the socket server

Reviewed By: @frantic

Differential Revision: D2462114
This commit is contained in:
Martin Bigio
2015-09-21 12:05:52 -07:00
committed by facebook-github-bot-9
parent f762a55abd
commit 8f5b2ccbe0

View File

@@ -37,6 +37,11 @@ class SocketServer {
});
});
process.on('uncaughtException', (error) => {
debug('uncaught error', error);
setImmediate(() => process.exit(1));
});
this._numConnections = 0;
this._server.on('connection', (sock) => this._handleConnection(sock));