Title: Printed errors should show cause · Issue #8856 · getsentry/sentry-javascript · GitHub
Open Graph Title: Printed errors should show cause · Issue #8856 · getsentry/sentry-javascript
X Title: Printed errors should show cause · Issue #8856 · getsentry/sentry-javascript
Description: Is there an existing issue for this? I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues I have reviewed the documentation https://docs.sentry.io/ I am using the latest SDK release https://github.com/...
Open Graph Description: Is there an existing issue for this? I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues I have reviewed the documentation https://docs.sentry.io/ I am using th...
X Description: Is there an existing issue for this? I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues I have reviewed the documentation https://docs.sentry.io/ I am using th...
Opengraph URL: https://github.com/getsentry/sentry-javascript/issues/8856
X: @github
Domain: github.com
IPv4 address: 140.82.114.4
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Printed errors should show cause","articleBody":"### Is there an existing issue for this?\n\n- [X] I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues\n- [X] I have reviewed the documentation https://docs.sentry.io/\n- [X] I am using the latest SDK release https://github.com/getsentry/sentry-javascript/releases\n\n### How do you use Sentry?\n\nSentry Saas (sentry.io)\n\n### Which SDK are you using?\n\n@sentry/node\n\n### SDK Version\n\n7.64.0\n\n### Framework Version\n\n_No response_\n\n### Link to Sentry event\n\n_No response_\n\n### SDK Setup\n\n_No response_\n\n### Steps to Reproduce\n\n```js\r\nconst Sentry = require('@sentry/node');\r\nSentry.init({ dsn: 'https://abc@app.getsentry.com/123' });\r\n\r\nthrow new Error('foo', { cause: 'bar' });\r\n```\r\n\r\n\n\n### Expected Result\n\nThe printed error should include the `cause`.\n\n### Actual Result\n\nThe printed error does not include the `cause`:\r\n\r\n```sh-session\r\n$ node test.js\r\nError: foo\r\n at Object.\u003canonymous> (/Users/oliver/Code/unsplash/unsplash-web/test.js:4:7)\r\n at Module._compile (node:internal/modules/cjs/loader:1254:14)\r\n at Module._extensions..js (node:internal/modules/cjs/loader:1308:10)\r\n at Module.load (node:internal/modules/cjs/loader:1117:32)\r\n at Module._load (node:internal/modules/cjs/loader:958:12)\r\n at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)\r\n at node:internal/main/run_main_module:23:47\r\n```\r\n\r\nIf we remove `Sentry.init`, the `cause` is shown:\r\n\r\n```sh-session\r\n$ node test.js\r\n/Users/oliver/Code/unsplash/unsplash-web/test.js:4\r\nthrow new Error('foo', { cause: 'bar' });\r\n^\r\n\r\nError: foo\r\n at Object.\u003canonymous> (/Users/oliver/Code/unsplash/unsplash-web/test.js:4:7)\r\n at Module._compile (node:internal/modules/cjs/loader:1254:14)\r\n at Module._extensions..js (node:internal/modules/cjs/loader:1308:10)\r\n at Module.load (node:internal/modules/cjs/loader:1117:32)\r\n at Module._load (node:internal/modules/cjs/loader:958:12)\r\n at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)\r\n at node:internal/main/run_main_module:23:47 {\r\n [cause]: 'bar'\r\n}\r\n```\r\n\r\nIt seems that Sentry is changing the way that exceptions are printed. I believe this custom logic needs to be updated to include the `cause`. Furthermore, I am wondering if it's possible to disable this and use Node's default behaviour?","author":{"url":"https://github.com/OliverJAsh","@type":"Person","name":"OliverJAsh"},"datePublished":"2023-08-22T08:16:09Z","url":"https://github.com/getsentry/sentry-javascript/issues/8856"}
| 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:8f0772cc-d3c6-dcb2-ba32-b5f68d74be54 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A622:3134C2:F80FF6:15B4645:6B04479B |
| html-safe-nonce | 8b84a0b048192c5d4c5ff593cebb0644133ac4dd381a9a0f2ec57b815715234c |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBNjIyOjMxMzRDMjpGODBGRjY6MTVCNDY0NTo2QjA0NDc5QiIsInZpc2l0b3JfaWQiOiI0OTM0ODM2NjUzNzQ0NDc0MDExIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 2387e3455a4b8188f21710a2d70d9650b75511d3bb0f79fad1ba4dc4d479a88f |
| hovercard-subject-tag | issue:1860886493 |
| 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/8856/issue_layout |
| twitter:image | https://opengraph.githubassets.com/63a8176d8ad34c139776e3b0ce9b99f8a9628b3182080768f8bc10b67a07be6d/getsentry/sentry-javascript/issues/8856 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/63a8176d8ad34c139776e3b0ce9b99f8a9628b3182080768f8bc10b67a07be6d/getsentry/sentry-javascript/issues/8856 |
| og:image:alt | Is there an existing issue for this? I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues I have reviewed the documentation https://docs.sentry.io/ I am using th... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | OliverJAsh |
| hostname | github.com |
| expected-hostname | github.com |
| None | d4495c3631faba668036f176d1f5946901c5172efd73a6edb984029e7d4f8e46 |
| 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 | 9ac4337fb7c6a5846cdfdb1a04f154d3c33ebc77 |
| 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