Title: Caught/Handled exceptions are always being logged as unhandled (@sentry/serverless) · Issue #5408 · getsentry/sentry-javascript · GitHub
Open Graph Title: Caught/Handled exceptions are always being logged as unhandled (@sentry/serverless) · Issue #5408 · getsentry/sentry-javascript
X Title: Caught/Handled exceptions are always being logged as unhandled (@sentry/serverless) · Issue #5408 · 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/5408
X: @github
Domain: github.com
IPv4 address: 140.82.113.3
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Caught/Handled exceptions are always being logged as unhandled (@sentry/serverless)","articleBody":"### Is there an existing issue for this?\r\n\r\n- [X] I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues\r\n- [X] I have reviewed the documentation https://docs.sentry.io/\r\n- [X] I am using the latest SDK release https://github.com/getsentry/sentry-javascript/releases\r\n\r\n### How do you use Sentry?\r\n\r\nSentry Saas (sentry.io)\r\n\r\n### Which package are you using?\r\n\r\n@sentry/serverless\r\n\r\n### SDK Version\r\n\r\n7.6.0\r\n\r\n### Framework Version\r\n\r\n7.6.0\r\n\r\n### Link to Sentry event\r\n\r\nhttps://sentry.io/organizations/kitup-stage/issues/3418028253/events/3127d807ee0e4ba2bda444c287041aad/?project=6521764\r\n\r\n### Steps to Reproduce\r\n\r\n1. Create a Lambda function and wrap it with the `Sentry.AWSLambda.wrapHandler()`\r\n2. Create a try/catch block\r\n3. In the try block, throw an error\r\n4. In the catch block, call `Sentry.captureException(error)` to catch and log the error\r\n5. Expected behavior is that the `handled` tag is set to `true` because the error or exception was caught within the tr/catch and not the `wrapHandler`. However, the caught error is _always_ flagged as unhandled `handled:false`\r\n\r\nThis might be the relevant code according to this [Discord discussion](https://discord.com/channels/621778831602221064/621786575591702529/996033341453246474) in Sentry discord : https://github.com/getsentry/sentry-javascript/blob/ce67a38259a4fb9ac9753a7bf3991ada78cc6102/packages/serverless/src/utils.ts#L12-L18\r\n\r\n\r\n\r\n### Expected Result\r\n\r\nErrors caught within a try/catch block and logged in the catch statement with Sentry.captureException(error) should be marked as `handled:true`\r\n\r\n### Actual Result\r\n\r\nErrors caught within the try/catch block are always marked as `handled:false`. \r\n\u003cimg width=\"836\" alt=\"Screen Shot 2022-07-11 at 2 26 27 PM\" src=\"https://user-images.githubusercontent.com/24727927/178361379-307783fe-e1cc-4457-852c-8d68a1ef843e.png\">\r\n\r\n","author":{"url":"https://github.com/whats-a-handle","@type":"Person","name":"whats-a-handle"},"datePublished":"2022-07-11T21:27:40Z","url":"https://github.com/getsentry/sentry-javascript/issues/5408"}
| 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:a8104add-6dc7-d18d-5518-e93e4c3c330e |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C41C:285B2D:24139DC:2FD31FE:6B036C09 |
| html-safe-nonce | c501088d5a579d574fd1ee94d109ba33896708cc1f0c0ef5da79ea83e0598c37 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDNDFDOjI4NUIyRDoyNDEzOURDOjJGRDMxRkU6NkIwMzZDMDkiLCJ2aXNpdG9yX2lkIjoiNzQyOTQwNjQ3NDQ3NDA1NjcxMyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | db47eb28faea4ea49593b1b8ae5e6a217188cd5a0e62af6e2634aaac8a4eecec |
| hovercard-subject-tag | issue:1301246549 |
| 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/5408/issue_layout |
| twitter:image | https://opengraph.githubassets.com/8e063658eafc9bf30366649e7b1bed3e93b6736512339adc894289a28752aea5/getsentry/sentry-javascript/issues/5408 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/8e063658eafc9bf30366649e7b1bed3e93b6736512339adc894289a28752aea5/getsentry/sentry-javascript/issues/5408 |
| 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 | whats-a-handle |
| hostname | github.com |
| expected-hostname | github.com |
| None | 87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456 |
| 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 | 423dbb54c5e7bfecc838eb387c1435eb3d0e760d |
| 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