From fe78c17ea6a2a37f8a9f74eca9b82e89dd290ec8 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Mon, 19 Jan 2015 12:48:49 -0800 Subject: [PATCH] Don't popup error if the user has a custom uncaught exception handler Fix #1012. --- atom/browser/lib/init.coffee | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/atom/browser/lib/init.coffee b/atom/browser/lib/init.coffee index d3234db757a0..65b7e4a19a4b 100644 --- a/atom/browser/lib/init.coffee +++ b/atom/browser/lib/init.coffee @@ -44,6 +44,10 @@ process.once 'BIND_DONE', -> # Don't quit on fatal error. process.on 'uncaughtException', (error) -> + # Do nothing if the user has a custom uncaught exception handler. + if process.listeners('uncaughtException').length > 1 + return + # Show error in GUI. stack = error.stack ? "#{error.name}: #{error.message}" message = "Uncaught Exception:\n#{stack}"