Don't popup error if the user has a custom uncaught exception handler
Fix #1012.
This commit is contained in:
parent
79a233436b
commit
fe78c17ea6
1 changed files with 4 additions and 0 deletions
|
@ -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}"
|
||||||
|
|
Loading…
Add table
Reference in a new issue