Title: Allow passing an object to `scope.setExtra` (et al) ? · Issue #1690 · getsentry/sentry-javascript · GitHub
Open Graph Title: Allow passing an object to `scope.setExtra` (et al) ? · Issue #1690 · getsentry/sentry-javascript
X Title: Allow passing an object to `scope.setExtra` (et al) ? · Issue #1690 · getsentry/sentry-javascript
Description: I'm creating an ErrorBoundary react component, and instead of doing this: componentDidCatch (error, errorInfo) { this.setState({ error, errorInfo }) Sentry.configureScope(scope => { Object.keys(errorInfo).forEach(key => { scope.setExtra(...
Open Graph Description: I'm creating an ErrorBoundary react component, and instead of doing this: componentDidCatch (error, errorInfo) { this.setState({ error, errorInfo }) Sentry.configureScope(scope => { Object.keys(err...
X Description: I'm creating an ErrorBoundary react component, and instead of doing this: componentDidCatch (error, errorInfo) { this.setState({ error, errorInfo }) Sentry.configureScope(scope => { Object.k...
Opengraph URL: https://github.com/getsentry/sentry-javascript/issues/1690
X: @github
Domain: github.com
IPv4 address: 140.82.112.4
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Allow passing an object to `scope.setExtra` (et al) ?","articleBody":"I'm creating an `ErrorBoundary` react component, and instead of doing this:\r\n\r\n```js\r\n componentDidCatch (error, errorInfo) {\r\n this.setState({ error, errorInfo })\r\n Sentry.configureScope(scope => {\r\n Object.keys(errorInfo).forEach(key => {\r\n scope.setExtra(key, errorInfo[key])\r\n })\r\n })\r\n Sentry.captureException(error)\r\n }\r\n```\r\n\r\nIt would be nice if `scope.setExtra` supported receiving an object (containing multiple \"extra\" key-extra pairs) so we could do something like this (`scope.setExtra` would do the `Object.keys` loop internally):\r\n\r\n```js\r\n componentDidCatch (error, errorInfo) {\r\n this.setState({ error, errorInfo })\r\n Sentry.configureScope(scope => { scope.setExtra(errorInfo) })\r\n Sentry.captureException(error)\r\n }\r\n```\r\n\r\nAny thoughts around implementing this? Thanks!","author":{"url":"https://github.com/benalman-toast","@type":"Person","name":"benalman-toast"},"datePublished":"2018-10-25T17:25:39Z","url":"https://github.com/getsentry/sentry-javascript/issues/1690"}
| 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:3c20d1fa-c0b8-f549-c4d1-20de83d6726a |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 91DE:3047DC:12D5DC:190F4A:6B04B17C |
| html-safe-nonce | 33c0cdcccd3cf24a23d6eda3a036b9c00ca8a3b27ee652ff994fb0a3b22ec805 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5MURFOjMwNDdEQzoxMkQ1REM6MTkwRjRBOjZCMDRCMTdDIiwidmlzaXRvcl9pZCI6IjYzNjIyMzYxNzgwNzAyODY3MTYiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 3ec57fad5acbbd4294a17f7ed9fbe8b24e6cd3db68b85c54a0727137997836fe |
| hovercard-subject-tag | issue:374051484 |
| 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/1690/issue_layout |
| twitter:image | https://opengraph.githubassets.com/17550726574994f30155d5208b2c9a6e0c27ba40092d2fb520191bc32a05e9ab/getsentry/sentry-javascript/issues/1690 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/17550726574994f30155d5208b2c9a6e0c27ba40092d2fb520191bc32a05e9ab/getsentry/sentry-javascript/issues/1690 |
| og:image:alt | I'm creating an ErrorBoundary react component, and instead of doing this: componentDidCatch (error, errorInfo) { this.setState({ error, errorInfo }) Sentry.configureScope(scope => { Object.keys(err... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | benalman-toast |
| hostname | github.com |
| expected-hostname | github.com |
| None | f1d110ea058a0915c1d8aa3fc2069fa15801e128f591e5762525abe77490ecb1 |
| 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 | ffa22a65e4c46d376940fe34b05e6a7e9c7fdb9b |
| 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