Title: Ensure usage of `captureException()` / `captureMessage()` with non-Error has correct top frame · Issue #8396 · getsentry/sentry-javascript · GitHub
Open Graph Title: Ensure usage of `captureException()` / `captureMessage()` with non-Error has correct top frame · Issue #8396 · getsentry/sentry-javascript
X Title: Ensure usage of `captureException()` / `captureMessage()` with non-Error has correct top frame · Issue #8396 · getsentry/sentry-javascript
Description: As brought up in #8296, currently the top frame points to internal code when using e.g.: Sentry.captureException(pojo); Sentry.captureMessage(pojo); This should point to the place where this was actually called. We use a synthetic except...
Open Graph Description: As brought up in #8296, currently the top frame points to internal code when using e.g.: Sentry.captureException(pojo); Sentry.captureMessage(pojo); This should point to the place where this was ac...
X Description: As brought up in #8296, currently the top frame points to internal code when using e.g.: Sentry.captureException(pojo); Sentry.captureMessage(pojo); This should point to the place where this was ac...
Opengraph URL: https://github.com/getsentry/sentry-javascript/issues/8396
X: @github
Domain: github.com
IPv4 address: 140.82.112.3
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Ensure usage of `captureException()` / `captureMessage()` with non-Error has correct top frame","articleBody":"As brought up in https://github.com/getsentry/sentry-javascript/issues/8296, currently the top frame points to internal code when using e.g.:\r\n\r\n```js\r\nSentry.captureException(pojo);\r\nSentry.captureMessage(pojo);\r\n```\r\n\r\nThis should point to the place where this was actually called.\r\n\r\nWe use a synthetic exception here, which has the stack from exactly where it was called - which is in the Sentry internals. So we need a way to remove this again somehow.\r\n\r\nSadly, this is different in different browsers, and made harder by minifaction. Some examples, non exhaustive but giving a good overview:\r\n\r\n## Chrome\r\n\r\nUnminified:\r\n```\r\nError: Sentry syntheticException\r\n at Hub.captureException (hub.ts:200:1)\r\n at Module.captureException (exports.ts:39:1)\r\n at updateCount (HelloWorld.vue:16:12)\r\n at callWithErrorHandling (runtime-core.esm-bundler.js:157:22)\r\n at callWithAsyncErrorHandling (runtime-core.esm-bundler.js:166:21)\r\n at HTMLButtonElement.invoker (runtime-dom.esm-bundler.js:345:9)\r\n at HTMLButtonElement.sentryWrapped (helpers.ts:98:1)\r\n```\r\n\r\nMinified:\r\n\r\n```\r\nError: Sentry syntheticException\r\n at Dl.captureException (hub.js:123:32)\r\n at Is (exports.js:20:26)\r\n at n (HelloWorld.vue:16:5)\r\n at Ce (runtime-core.esm-bundler.js:157:22)\r\n at qt (runtime-core.esm-bundler.js:166:21)\r\n at HTMLButtonElement.n (runtime-dom.esm-bundler.js:345:9)\r\n at HTMLButtonElement.r (helpers.js:90:17)\r\n```\r\n\r\n## Safari\r\n\r\nUnminified:\r\n```\r\ncaptureException@http://localhost:5173/@fs/Users/francesco/git/sentry-javascript/packages/core/build/esm/hub.js?t=1687528488715:123:41\r\nupdateCount@http://localhost:5173/src/components/HelloWorld.vue?t=1687528678533:22:28\r\ncallWithErrorHandling@http://localhost:5173/node_modules/.vite/deps/vue.js?v=9b021ca7:1378:20\r\ncallWithAsyncErrorHandling@http://localhost:5173/node_modules/.vite/deps/vue.js?v=9b021ca7:1386:38\r\ninvoker@http://localhost:5173/node_modules/.vite/deps/vue.js?v=9b021ca7:7574:31\r\nsentryWrapped@http://localhost:5173/@fs/Users/francesco/git/sentry-javascript/packages/browser/build/npm/esm/helpers.js?t=1687528678440:90:22\r\n```\r\n\r\nMinified:\r\n```\r\ncaptureException@http://localhost:4173/assets/index.8e4e6fdb.js:7:10497\r\nn@http://localhost:4173/assets/index.8e4e6fdb.js:37:3522\r\nCe@http://localhost:4173/assets/index.8e4e6fdb.js:1:12584\r\nqt@http://localhost:4173/assets/index.8e4e6fdb.js:1:12663\r\nn@http://localhost:4173/assets/index.8e4e6fdb.js:1:51488\r\nr@http://localhost:4173/assets/index.8e4e6fdb.js:19:1496\r\n```\r\n\r\n## Firefox\r\n\r\nUnminified:\r\n```\r\ncaptureException@http://localhost:5173/@fs/Users/francesco/git/sentry-javascript/packages/core/build/esm/hub.js?t=1687528488715:123:32\r\ncaptureException@http://localhost:5173/@fs/Users/francesco/git/sentry-javascript/packages/core/build/esm/exports.js?t=1687528488715:20:26\r\nupdateCount@http://localhost:5173/src/components/HelloWorld.vue?t=1687528678533:22:12\r\ncallWithErrorHandling@http://localhost:5173/node_modules/.vite/deps/vue.js?v=9b021ca7:1378:18\r\ncallWithAsyncErrorHandling@http://localhost:5173/node_modules/.vite/deps/vue.js?v=9b021ca7:1386:38\r\ninvoker@http://localhost:5173/node_modules/.vite/deps/vue.js?v=9b021ca7:7574:31\r\nsentryWrapped@http://localhost:5173/@fs/Users/francesco/git/sentry-javascript/packages/browser/build/npm/esm/helpers.js?t=1687528678440:90:17\r\n```\r\n\r\nMinified:\r\n```\r\ncaptureException@http://localhost:4173/assets/index.8e4e6fdb.js:7:10488\r\nIs@http://localhost:4173/assets/index.8e4e6fdb.js:11:906\r\nn@http://localhost:4173/assets/index.8e4e6fdb.js:37:3520\r\nCe@http://localhost:4173/assets/index.8e4e6fdb.js:1:12583\r\nqt@http://localhost:4173/assets/index.8e4e6fdb.js:1:12663\r\nn@http://localhost:4173/assets/index.8e4e6fdb.js:1:51488\r\nr@http://localhost:4173/assets/index.8e4e6fdb.js:19:1491\r\nEventListener.handleEvent*lm/\u003c/\u003c@http://localhost:4173/assets/index.8e4e6fdb.js:19:15731\r\nGh/\u003c/\u003c/\u003c@http://localhost:4173/assets/index.8e4e6fdb.js:5:3547\r\nVf@http://localhost:4173/assets/index.8e4e6fdb.js:1:50852\r\nXf@http://localhost:4173/assets/index.8e4e6fdb.js:1:51058\r\nrh@http://localhost:4173/assets/index.8e4e6fdb.js:1:51826\r\nH@http://localhost:4173/assets/index.8e4e6fdb.js:1:34294\r\nA@http://localhost:4173/assets/index.8e4e6fdb.js:1:33991\r\nT@http://localhost:4173/assets/index.8e4e6fdb.js:1:33421\r\nR@http://localhost:4173/assets/index.8e4e6fdb.js:1:34890\r\nH@http://localhost:4173/assets/index.8e4e6fdb.js:1:34172\r\nA@http://localhost:4173/assets/index.8e4e6fdb.js:1:33991\r\nT@http://localhost:4173/assets/index.8e4e6fdb.js:1:33421\r\nR@http://localhost:4173/assets/index.8e4e6fdb.js:1:34890\r\nnt@http://localhost:4173/assets/index.8e4e6fdb.js:1:36286\r\nT@http://localhost:4173/assets/index.8e4e6fdb.js:1:33383\r\nw@http://localhost:4173/assets/index.8e4e6fdb.js:1:37616\r\nrun@http://localhost:4173/assets/index.8e4e6fdb.js:1:4686\r\ntt/f.update@http://localhost:4173/assets/index.8e4e6fdb.js:1:37884\r\ntt@http://localhost:4173/assets/index.8e4e6fdb.js:1:37910\r\nV@http://localhost:4173/assets/index.8e4e6fdb.js:1:36747\r\nI@http://localhost:4173/assets/index.8e4e6fdb.js:1:36540\r\nT@http://localhost:4173/assets/index.8e4e6fdb.js:1:33446\r\nR@http://localhost:4173/assets/index.8e4e6fdb.js:1:34890\r\nnt@http://localhost:4173/assets/index.8e4e6fdb.js:1:36286\r\nT@http://localhost:4173/assets/index.8e4e6fdb.js:1:33383\r\nw@http://localhost:4173/assets/index.8e4e6fdb.js:1:37616\r\nrun@http://localhost:4173/assets/index.8e4e6fdb.js:1:4686\r\ntt/f.update@http://localhost:4173/assets/index.8e4e6fdb.js:1:37884\r\ntt@http://localhost:4173/assets/index.8e4e6fdb.js:1:37910\r\nV@http://localhost:4173/assets/index.8e4e6fdb.js:1:36747\r\nI@http://localhost:4173/assets/index.8e4e6fdb.js:1:36540\r\nT@http://localhost:4173/assets/index.8e4e6fdb.js:1:33446\r\nMt@http://localhost:4173/assets/index.8e4e6fdb.js:1:41571\r\nmount@http://localhost:4173/assets/index.8e4e6fdb.js:1:31962\r\nch/e.mount@http://localhost:4173/assets/index.8e4e6fdb.js:1:52858\r\n```\r\n\r\n## Current output frames (e.g. Chrome)\r\n\r\n```\r\n[\r\n {\r\n \"filename\": \"http://localhost:5173/node_modules/.vite/deps/vue.js?v=9b021ca7\",\r\n \"function\": \"HTMLButtonElement.invoker\",\r\n \"in_app\": true,\r\n \"lineno\": 7574,\r\n \"colno\": 5\r\n },\r\n {\r\n \"filename\": \"http://localhost:5173/node_modules/.vite/deps/vue.js?v=9b021ca7\",\r\n \"function\": \"callWithAsyncErrorHandling\",\r\n \"in_app\": true,\r\n \"lineno\": 1386,\r\n \"colno\": 17\r\n },\r\n {\r\n \"filename\": \"http://localhost:5173/node_modules/.vite/deps/vue.js?v=9b021ca7\",\r\n \"function\": \"callWithErrorHandling\",\r\n \"in_app\": true,\r\n \"lineno\": 1378,\r\n \"colno\": 18\r\n },\r\n {\r\n \"filename\": \"http://localhost:5173/src/components/HelloWorld.vue?t=1687529456042\",\r\n \"function\": \"updateCount\",\r\n \"in_app\": true,\r\n \"lineno\": 22,\r\n \"colno\": 12\r\n },\r\n {\r\n \"filename\": \"http://localhost:5173/@fs/Users/francesco/git/sentry-javascript/packages/core/build/esm/exports.js\",\r\n \"function\": \"Module.captureException\",\r\n \"in_app\": true,\r\n \"lineno\": 20,\r\n \"colno\": 26\r\n }\r\n]\r\n```\r\n\r\nNote that Safari seems to have a correct frames output, but FF & Chrome do not.\r\n\r\n## Expected output frames\r\n\r\n```\r\n[\r\n {\r\n \"filename\": \"http://localhost:5173/node_modules/.vite/deps/vue.js?v=9b021ca7\",\r\n \"function\": \"HTMLButtonElement.invoker\",\r\n \"in_app\": true,\r\n \"lineno\": 7574,\r\n \"colno\": 5\r\n },\r\n {\r\n \"filename\": \"http://localhost:5173/node_modules/.vite/deps/vue.js?v=9b021ca7\",\r\n \"function\": \"callWithAsyncErrorHandling\",\r\n \"in_app\": true,\r\n \"lineno\": 1386,\r\n \"colno\": 17\r\n },\r\n {\r\n \"filename\": \"http://localhost:5173/node_modules/.vite/deps/vue.js?v=9b021ca7\",\r\n \"function\": \"callWithErrorHandling\",\r\n \"in_app\": true,\r\n \"lineno\": 1378,\r\n \"colno\": 18\r\n },\r\n {\r\n \"filename\": \"http://localhost:5173/src/components/HelloWorld.vue\",\r\n \"function\": \"updateCount\",\r\n \"in_app\": true,\r\n \"lineno\": 22,\r\n \"colno\": 12\r\n }\r\n]\r\n```\r\n","author":{"url":"https://github.com/mydea","@type":"Person","name":"mydea"},"datePublished":"2023-06-23T14:13:34Z","url":"https://github.com/getsentry/sentry-javascript/issues/8396"}
| 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:9cc1cafb-647b-b0dd-7882-77dec2ee5160 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C24E:AF089:626822:84A91F:6B04A2F6 |
| html-safe-nonce | b827e6b7ff5e7e256c97fa3fc5d2d8327f2cb7322cc8b7c8db4c7cfcf09d008f |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDMjRFOkFGMDg5OjYyNjgyMjo4NEE5MUY6NkIwNEEyRjYiLCJ2aXNpdG9yX2lkIjoiMzE2MzMwNjgwMDQyNjgyMDM0MiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | f46634a9b48ecd60e9039c2468e0174784c4a1b199d12366625af760453e8f15 |
| hovercard-subject-tag | issue:1771536044 |
| 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/8396/issue_layout |
| twitter:image | https://opengraph.githubassets.com/cda809ba2fb6c153188c49bfe018a04e2da886d73945097bb6262efe855d4d51/getsentry/sentry-javascript/issues/8396 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/cda809ba2fb6c153188c49bfe018a04e2da886d73945097bb6262efe855d4d51/getsentry/sentry-javascript/issues/8396 |
| og:image:alt | As brought up in #8296, currently the top frame points to internal code when using e.g.: Sentry.captureException(pojo); Sentry.captureMessage(pojo); This should point to the place where this was ac... |
| 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 | 9784b6f42e2d5eac4e394fa88cad134c0dc5b6662b4ff2787a1ed1ef5a96331d |
| 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 | 3fd14143b75b2af7b76bbd23b069867d091adfcc |
| 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