]> khamidou — GitHub mirrors - electron.git/commitdiff
Don't popup error if the user has a custom uncaught exception handler
authorCheng Zhao <zcbenz@gmail.com>
Mon, 19 Jan 2015 20:48:49 +0000 (12:48 -0800)
committerCheng Zhao <zcbenz@gmail.com>
Mon, 19 Jan 2015 20:50:44 +0000 (12:50 -0800)
Fix #1012.

atom/browser/lib/init.coffee

index d3234db757a08c0c6fdfc5714084010b92253c4a..65b7e4a19a4ba0246fba420cabccb9bd138361a7 100644 (file)
@@ -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}"