Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add default error handler to remote promises #6151

Merged
merged 7 commits into from Jun 21, 2016

Conversation

Projects
None yet
2 participants
@kevinsawicki
Copy link
Contributor

kevinsawicki commented Jun 20, 2016

This pull request adds a default onFullfilled/onRejection handler to remote promises so that unhandled rejections of remote promises appear in the renderer process instead of the main process.

Also adds some var -> const/let formatting to rpc-server.js.

Closes #6113

@kevinsawicki kevinsawicki changed the title Add default promise handler to remote promises Add default error handler to remote promises Jun 20, 2016

@@ -93,6 +93,10 @@ let valueToMeta = function (sender, value, optimizeSimpleObject = false) {
} else if (meta.type === 'buffer') {
meta.value = Array.prototype.slice.call(value, 0)
} else if (meta.type === 'promise') {
// Add default handler to prevent unhandled rejections in main process
// Instead they should appear in the renderer process
value.then(function () {}, function () {})

This comment has been minimized.

Copy link
@kevinsawicki

kevinsawicki Jun 20, 2016

Author Contributor

This is the main change here 👀

@zcbenz

This comment has been minimized.

Copy link
Member

zcbenz commented Jun 21, 2016

👍

@zcbenz zcbenz merged commit 8a9f226 into master Jun 21, 2016

8 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
electron-linux-arm Build #3482088 succeeded in 66s
Details
electron-linux-ia32 Build #3482089 succeeded in 61s
Details
electron-linux-x64 Build #3482090 succeeded in 123s
Details
electron-mas-x64 Build #1620 succeeded in 6 min 11 sec
Details
electron-osx-x64 Build #1625 succeeded in 6 min 15 sec
Details
electron-win-ia32 Build #622 succeeded in 6 min 23 sec
Details
electron-win-x64 Build #616 succeeded in 6 min 29 sec
Details

@zcbenz zcbenz deleted the promise-rejection branch Jun 21, 2016

@zcbenz

This comment has been minimized.

Copy link
Member

zcbenz commented Jun 21, 2016

Oops, sorry I used squashed merge instead of normal merge for the PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.