mirror of
https://github.com/Foundry376/Mailspring.git
synced 2025-03-10 15:05:02 +08:00
fix(error): also listen to process errors in windows for async/await
This commit is contained in:
parent
395a703fad
commit
f1e4ba2bd0
2 changed files with 5 additions and 2 deletions
2
src/K2
2
src/K2
|
@ -1 +1 @@
|
||||||
Subproject commit 42e0854ebeb7e8795532519db40fa03764cc1d65
|
Subproject commit a865fabe488eb853f347e3062c9ea9459df12d67
|
|
@ -237,6 +237,9 @@ class NylasEnvConstructor
|
||||||
|
|
||||||
@reportError(error, {promise})
|
@reportError(error, {promise})
|
||||||
|
|
||||||
|
process.on('uncaughtException', @reportError)
|
||||||
|
process.on('unhandledRejection', @reportError)
|
||||||
|
|
||||||
if @inSpecMode() or @inDevMode()
|
if @inSpecMode() or @inDevMode()
|
||||||
Promise.longStackTraces()
|
Promise.longStackTraces()
|
||||||
|
|
||||||
|
@ -259,7 +262,7 @@ class NylasEnvConstructor
|
||||||
# The difference between this and `ErrorLogger.reportError` is that
|
# The difference between this and `ErrorLogger.reportError` is that
|
||||||
# `NylasEnv.reportError` will hook into the event callbacks and handle
|
# `NylasEnv.reportError` will hook into the event callbacks and handle
|
||||||
# test failures and dev tool popups.
|
# test failures and dev tool popups.
|
||||||
reportError: (error, extra={}, {noWindows}={}) ->
|
reportError: (error, extra={}, {noWindows}={}) =>
|
||||||
event = @_createErrorCallbackEvent(error, extra)
|
event = @_createErrorCallbackEvent(error, extra)
|
||||||
@emitter.emit('will-throw-error', event)
|
@emitter.emit('will-throw-error', event)
|
||||||
return if event.defaultPrevented
|
return if event.defaultPrevented
|
||||||
|
|
Loading…
Reference in a new issue