From f1e4ba2bd0f0dae9d03f0c03ed51bde239511b82 Mon Sep 17 00:00:00 2001 From: Evan Morikawa Date: Fri, 13 Jan 2017 16:17:47 -0800 Subject: [PATCH] fix(error): also listen to process errors in windows for async/await --- src/K2 | 2 +- src/nylas-env.coffee | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/K2 b/src/K2 index 42e0854eb..a865fabe4 160000 --- a/src/K2 +++ b/src/K2 @@ -1 +1 @@ -Subproject commit 42e0854ebeb7e8795532519db40fa03764cc1d65 +Subproject commit a865fabe488eb853f347e3062c9ea9459df12d67 diff --git a/src/nylas-env.coffee b/src/nylas-env.coffee index 536f6bcae..073123b4a 100644 --- a/src/nylas-env.coffee +++ b/src/nylas-env.coffee @@ -237,6 +237,9 @@ class NylasEnvConstructor @reportError(error, {promise}) + process.on('uncaughtException', @reportError) + process.on('unhandledRejection', @reportError) + if @inSpecMode() or @inDevMode() Promise.longStackTraces() @@ -259,7 +262,7 @@ class NylasEnvConstructor # The difference between this and `ErrorLogger.reportError` is that # `NylasEnv.reportError` will hook into the event callbacks and handle # test failures and dev tool popups. - reportError: (error, extra={}, {noWindows}={}) -> + reportError: (error, extra={}, {noWindows}={}) => event = @_createErrorCallbackEvent(error, extra) @emitter.emit('will-throw-error', event) return if event.defaultPrevented