Skip to content

Sentry.wrapHandler() not optional when using @sentry/serverless-aws but docs suggest it is #17774

@callumgare

Description

@callumgare

Is there an existing issue for this?

How do you use Sentry?

Sentry Saas (sentry.io)

Which SDK are you using?

@sentry/aws-serverless

SDK Version

10.15.0

Framework Version

No response

Link to Sentry event

No response

Reproduction Example/SDK Setup

https://github.com/callumgare/sentry-lambda-http-proxy-issue

Steps to Reproduce

The sentry docs seem to indicate that you can throw an error and have it reported to Sentry without using
Sentry.wrapHandler():

But as best as I can tell this doesn't seem to be the case. If you deploy the code in the reproduction repo without the USE_SENTRY_WRAPPER env var set so Sentry.wrapHandler() isn't used and send a request to the function url then you should see the error "This always gets reported" in sentry but not the error "This only gets reported if using Sentry.wrapHandler()". Redeploying again with USE_SENTRY_WRAPPER set to true you should now see both.

Expected Result

I would expect the thrown error to be reported (or the docs to indicate that Sentry.wrapHandler()` is required to receive thrown errors).

Actual Result

Following the steps to reproduce you should see something like this:
Image
(note the event count)

Additional Context

Tip: React with 👍 to help prioritize this issue. Please use comments to provide useful context, avoiding +1 or me too, to help us triage it.

Metadata

Metadata

Assignees

No one assigned

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions