Don't popup error if the user has a custom uncaught exception handler

Fix #1012.
This commit is contained in:
Cheng Zhao 2015-01-19 12:48:49 -08:00
parent 79a233436b
commit fe78c17ea6

View file

@ -44,6 +44,10 @@ process.once 'BIND_DONE', ->
# Don't quit on fatal error. # Don't quit on fatal error.
process.on 'uncaughtException', (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. # Show error in GUI.
stack = error.stack ? "#{error.name}: #{error.message}" stack = error.stack ? "#{error.name}: #{error.message}"
message = "Uncaught Exception:\n#{stack}" message = "Uncaught Exception:\n#{stack}"