Title: Default Unhandled Rejection Detection Behavior · Issue #830 · nodejs/node · GitHub
Open Graph Title: Default Unhandled Rejection Detection Behavior · Issue #830 · nodejs/node
X Title: Default Unhandled Rejection Detection Behavior · Issue #830 · nodejs/node
Description: With #758 (hopefully) soon landing to address #256 we will soon have unhandled promise rejections reported to the process via a process.on("unhandledRejection" event. One issue that was deliberately deferred from that issue and PR is wha...
Open Graph Description: With #758 (hopefully) soon landing to address #256 we will soon have unhandled promise rejections reported to the process via a process.on("unhandledRejection" event. One issue that was deliberatel...
X Description: With #758 (hopefully) soon landing to address #256 we will soon have unhandled promise rejections reported to the process via a process.on("unhandledRejection" event. One issue that was d...
Opengraph URL: https://github.com/nodejs/node/issues/830
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Default Unhandled Rejection Detection Behavior","articleBody":"With https://github.com/iojs/io.js/pull/758/ (hopefully) soon landing to address https://github.com/iojs/io.js/issues/256 we will soon have unhandled promise rejections reported to the process via a `process.on(\"unhandledRejection\"` event. \n\nOne issue that was deliberately deferred from that issue and PR is what the default behaviour of an unhandled promise rejection detected be.\n\nJust to be clear - this is about the default behaviour of a rejected promise with no `catch` handler (or `then` handler with a function second argument) attached.\n## **The different approaches**\n- Logging the rejection to the console.\n- Throwing an error for `process.on(\"uncaughtException\"` to deal with.\n- Causing the process to exit.\n- Do nothing by default.\n\nThere are several good arguments for each approach. I'll write down the arguments I'm aware of and will edit arguments as people make them in comments.\n### Logging\n- No silent failure by default.\n- Does not break any existing code - no \"surprises\". (See comment by @vkurchatkin on this)\n- Been a default in several userland libraries like bluebird and users have been very satisfied with it.\n### Throwing an error\n- A promise rejection is the asynchronous version of a thrown exception.\n- Does not ignore logical errors or leave the app in an inconsistent state. \n- False positives are extremely rare - and code causing them can arguably easily be refactored to not cause them by not attaching error handlers too late.\n### Process Exit\n- Differentiation between uncaught exceptions and promise rejections might be useful.\n### Do nothing\n- Reliable promise rejection detection is non-deciable, it's possible to report an unhandled rejection that actually is handled at a later point if the catch handler is attached at a very late time. \n- Does not break any existing workflows for anyone. No backwards compatibility issues for native promise users at all.\n- Does not make any assumptions on how people use native promises.\n\n---\n\nWhat do people think the default behaviour should be?\n","author":{"url":"https://github.com/benjamingr","@type":"Person","name":"benjamingr"},"datePublished":"2015-02-13T11:31:38.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":135},"url":"https://github.com/830/node/issues/830"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:f8c49841-89d9-0602-b805-843dd16d21e9 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E898:5105D:865B9A7:BC3E220:6A505C46 |
| html-safe-nonce | 35336eac356eebb9ae43a1d23915c1219e0f75ba133fa4972d808669180d9d07 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFODk4OjUxMDVEOjg2NUI5QTc6QkMzRTIyMDo2QTUwNUM0NiIsInZpc2l0b3JfaWQiOiI2MzM3MDE4NTM0MTUxMDM1NTgiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 6cae9114baf5947ff66cb7da0d24d15cf599b6f00401b2388b8dd1bbf9039b49 |
| hovercard-subject-tag | issue:57588499 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/nodejs/node/830/issue_layout |
| twitter:image | https://opengraph.githubassets.com/d1188536337721ac2f446cf11a46702379e401159dcb7eaa0443bf7e0dd698f5/nodejs/node/issues/830 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/d1188536337721ac2f446cf11a46702379e401159dcb7eaa0443bf7e0dd698f5/nodejs/node/issues/830 |
| og:image:alt | With #758 (hopefully) soon landing to address #256 we will soon have unhandled promise rejections reported to the process via a process.on("unhandledRejection" event. One issue that was deliberatel... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | benjamingr |
| hostname | github.com |
| expected-hostname | github.com |
| None | d6dc8294eb500fa36bbc57472d61fe87c522f9c3c1d64f70f4926f66a66a7efb |
| turbo-cache-control | no-preview |
| go-import | github.com/nodejs/node git https://github.com/nodejs/node.git |
| octolytics-dimension-user_id | 9950313 |
| octolytics-dimension-user_login | nodejs |
| octolytics-dimension-repository_id | 27193779 |
| octolytics-dimension-repository_nwo | nodejs/node |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 27193779 |
| octolytics-dimension-repository_network_root_nwo | nodejs/node |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 7ac0ad2f2c7e4b9056617355fd9e33e22b0c8df9 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width