From 995a8311de793ff2301f1f55fd7119c9ae910620 Mon Sep 17 00:00:00 2001 From: Andre Medeiros Date: Tue, 23 Jul 2019 17:24:02 -0400 Subject: [PATCH] fix: don't swallow uncaughtException --- lib/widgets/screen.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/lib/widgets/screen.js b/lib/widgets/screen.js index 9d76e58..a6fcbb6 100644 --- a/lib/widgets/screen.js +++ b/lib/widgets/screen.js @@ -209,14 +209,11 @@ Screen.bind = function(screen) { Screen._bound = true; process.on('uncaughtException', Screen._exceptionHandler = function(err) { - if (process.listeners('uncaughtException').length > 1) { - return; - } Screen.instances.slice().forEach(function(screen) { screen.destroy(); }); err = err || new Error('Uncaught Exception.'); - console.error(err.stack ? err.stack + '' : err + ''); + process.stderr.write((err.stack || err) + "\n"); nextTick(function() { process.exit(1); });