Title: Improve node `OnUncaughtException` integration · Issue #6146 · getsentry/sentry-javascript · GitHub
Open Graph Title: Improve node `OnUncaughtException` integration · Issue #6146 · getsentry/sentry-javascript
X Title: Improve node `OnUncaughtException` integration · Issue #6146 · getsentry/sentry-javascript
Description: Problem Statement The current integration configuration for the node OnUncaughtExceptionOptions exception can be a bit confusing, especially with recently necessary changes regarding the default behavior. Current behavior: Following the ...
Open Graph Description: Problem Statement The current integration configuration for the node OnUncaughtExceptionOptions exception can be a bit confusing, especially with recently necessary changes regarding the default be...
X Description: Problem Statement The current integration configuration for the node OnUncaughtExceptionOptions exception can be a bit confusing, especially with recently necessary changes regarding the default be...
Opengraph URL: https://github.com/getsentry/sentry-javascript/issues/6146
X: @github
Domain: github.com
IPv4 address: 140.82.112.3
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Improve node `OnUncaughtException` integration","articleBody":"### Problem Statement\r\n\r\nThe current integration configuration for the node `OnUncaughtExceptionOptions` exception can be a bit confusing, especially with recently necessary changes regarding the default behavior.\r\n\r\nCurrent behavior:\r\n\r\n* Following the node.js default, we exit the process on uncaught exceptions\r\n* For e.g. next.js, we need the capability to opt out of this behavior - however, we only want to opt out of it _if_ any other handler has been registered.\r\n* Then there is also the option of providing an `onFatalError` handler to conditionally define if the process should exit or not\r\n\r\n### Solution Brainstorm\r\n\r\nWe could add a new option to (eventually) replace all existing options, e.g. `mode`.\r\n\r\nA possible API could be:\r\n\r\n```ts\r\ntype OnUncaughtExceptionMode = 'exit' | 'continue' | (firstError: Error, secondError?: Error) => boolean;\r\n\r\n// default, matches node.js\r\nnew OnUncaughtException({\r\n onException: 'exit'\r\n});\r\n\r\nnew OnUncaughtException({\r\n onException: 'continue'\r\n});\r\n\r\nnew OnUncaughtException({\r\n onException: (error) => {\r\n // do something\r\n // return `true` to exit the process, any other return value will keep it running\r\n return true;\r\n }\r\n});\r\n```\r\n\r\nWith the behaviour:\r\n\r\n* `exit`: Always exit the process on uncaught exceptions. The default.\r\n* `continue`: Do not exit the process. Could be set by the next.js integration.\r\n* a function: Leave this to the user. Can eventually replace `onFatalError`","author":{"url":"https://github.com/mydea","@type":"Person","name":"mydea"},"datePublished":"2022-11-07T16:00:24Z","url":"https://github.com/getsentry/sentry-javascript/issues/6146"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| 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:146c9e04-4854-53aa-c3f1-04749f9f6cfb |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B14A:21A483:1EE0D9D:29A1C34:6B044C41 |
| html-safe-nonce | 754f3cb371d9051c4995a6423d89641364cbddb3d8bc264f309fab4a558df4f2 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCMTRBOjIxQTQ4MzoxRUUwRDlEOjI5QTFDMzQ6NkIwNDRDNDEiLCJ2aXNpdG9yX2lkIjoiODEzNDA3NzU1Mzk1NTg1MTMyOSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 23683282701896f51670e6e7c5af955d1d4e0ddb2bbae35e75f0f8ffc89c7931 |
| hovercard-subject-tag | issue:1438596651 |
| 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/getsentry/sentry-javascript/6146/issue_layout |
| twitter:image | https://opengraph.githubassets.com/e944463f9ad75af07ddc6eafa27c42a65c83f79c12cf8eaf55f13e7c6257c09b/getsentry/sentry-javascript/issues/6146 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/e944463f9ad75af07ddc6eafa27c42a65c83f79c12cf8eaf55f13e7c6257c09b/getsentry/sentry-javascript/issues/6146 |
| og:image:alt | Problem Statement The current integration configuration for the node OnUncaughtExceptionOptions exception can be a bit confusing, especially with recently necessary changes regarding the default be... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | mydea |
| hostname | github.com |
| expected-hostname | github.com |
| None | 002aa6b95ffa730b0aec436a5c383f536ad677284e60056037fb120afe37b730 |
| turbo-cache-control | no-preview |
| go-import | github.com/getsentry/sentry-javascript git https://github.com/getsentry/sentry-javascript.git |
| octolytics-dimension-user_id | 1396951 |
| octolytics-dimension-user_login | getsentry |
| octolytics-dimension-repository_id | 3328572 |
| octolytics-dimension-repository_nwo | getsentry/sentry-javascript |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 3328572 |
| octolytics-dimension-repository_network_root_nwo | getsentry/sentry-javascript |
| 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 | 059f24c781e3a0d7df3f27a97da0e93fab06ae39 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width