Closed
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/getsentry/sentry-javascript/releases
How do you use Sentry?
Sentry Saas (sentry.io)
Which package are you using?
@sentry/serverless
SDK Version
7.6.0
Framework Version
7.6.0
Link to Sentry event
Steps to Reproduce
- Create a Lambda function and wrap it with the
Sentry.AWSLambda.wrapHandler()
- Create a try/catch block
- In the try block, throw an error
- In the catch block, call
Sentry.captureException(error)
to catch and log the error - Expected behavior is that the
handled
tag is set totrue
because the error or exception was caught within the tr/catch and not thewrapHandler
. However, the caught error is always flagged as unhandledhandled:false
This might be the relevant code according to this Discord discussion in Sentry discord :
sentry-javascript/packages/serverless/src/utils.ts
Lines 12 to 18 in ce67a38
Expected Result
Errors caught within a try/catch block and logged in the catch statement with Sentry.captureException(error) should be marked as handled:true
Actual Result
Errors caught within the try/catch block are always marked as handled:false
.
Metadata
Metadata
Assignees
Type
Projects
Status
No status