From 2b12f61602136830ec8bb9bbab6a5618cbf6818d Mon Sep 17 00:00:00 2001 From: Joshua Spence Date: Tue, 20 Jan 2015 06:36:51 +1100 Subject: [PATCH] Don't exit from the Aphlict Server prematurely Summary: By calling `process.exit(1)` we are forcing the Node.js process to exit prematurely. Specifically, the process is terminated before the error is written to the log file. This can be verified by inspecting the value of `debug._logs[0]._writableState.writing` immediately before the process is terminated. Test Plan: Ran `./bin/aphlict debug` without the `ws` module being installed. Verified that `<<< UNCAUGHT EXCEPTION! >>>` was echoed to the console as well as the log file. Also verified that the exit status was non-zero. Reviewers: #blessed_reviewers, epriestley Reviewed By: #blessed_reviewers, epriestley Subscribers: Korvin, epriestley Differential Revision: https://secure.phabricator.com/D11426 --- support/aphlict/server/aphlict_server.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/support/aphlict/server/aphlict_server.js b/support/aphlict/server/aphlict_server.js index 2ec7f97714..6b8795d41b 100644 --- a/support/aphlict/server/aphlict_server.js +++ b/support/aphlict/server/aphlict_server.js @@ -60,8 +60,6 @@ process.on('uncaughtException', function(err) { message.push(err.stack); debug.log(message.join('\n\n')); - - process.exit(1); }); try {