From 60d2b743d90077d73f832da96f25c3ec05d344de Mon Sep 17 00:00:00 2001 From: epriestley Date: Wed, 11 Jun 2014 10:40:04 -0700 Subject: [PATCH] Print out stack traces when Aphlict server dies Summary: Printing out `err` is less informative than `err.stack`, which has the message, type, //and// a trace. Test Plan: Faked an exception, then: ``` $ sudo ./bin/aphlict debug Starting Aphlict server in foreground... Launching server: $ 'node' '/INSECURE/devtools/phabricator/src/applications/aphlict/management/../../../../support/aphlict/server/aphlict_server.js' --port='22280' --admin='22281' --host='localhost' [Wed Jun 11 2014 10:20:39 GMT-0700 (PDT)] <<< UNCAUGHT EXCEPTION! >>> Error: Example Exception at Object. (/INSECURE/devtools/phabricator/support/aphlict/server/aphlict_server.js:73:7) at Module._compile (module.js:456:26) at Object.Module._extensions..js (module.js:474:10) at Module.load (module.js:356:32) at Function.Module._load (module.js:312:12) at Function.Module.runMain (module.js:497:10) at startup (node.js:119:16) at node.js:901:3 >>> Server exited! ``` Reviewers: joshuaspence Reviewed By: joshuaspence Subscribers: epriestley Differential Revision: https://secure.phabricator.com/D9481 --- support/aphlict/server/aphlict_server.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/support/aphlict/server/aphlict_server.js b/support/aphlict/server/aphlict_server.js index 74374ea132..a6e803bf34 100644 --- a/support/aphlict/server/aphlict_server.js +++ b/support/aphlict/server/aphlict_server.js @@ -65,7 +65,8 @@ var http = require('http'); var url = require('url'); process.on('uncaughtException', function(err) { - debug.log("\n<<< UNCAUGHT EXCEPTION! >>>\n\n" + err); + debug.log("\n<<< UNCAUGHT EXCEPTION! >>>\n" + err.stack); + process.exit(1); });