Skip to content

Conversation

@lforst
Copy link
Contributor

@lforst lforst commented Dec 5, 2024

DESCRIBE YOUR PR

Hopefully makes it a bit more clear how specific error filters need to be transformed so that they will capture errors.

closes getsentry/sentry-javascript#14580

IS YOUR CHANGE URGENT?

Help us prioritize incoming PRs by letting us know when the change needs to go live.

  • Urgent deadline (GA date, etc.):
  • Other deadline:
  • None: Not urgent, can wait up to 1 week+

@vercel
Copy link

vercel bot commented Dec 5, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
sentry-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 5, 2024 0:35am
2 Skipped Deployments
Name Status Preview Comments Updated (UTC)
changelog ⬜️ Ignored (Inspect) Visit Preview Dec 5, 2024 0:35am
develop-docs ⬜️ Ignored (Inspect) Visit Preview Dec 5, 2024 0:35am

@codecov
Copy link

codecov bot commented Dec 5, 2024

Bundle Report

Changes will decrease total bundle size by 15 bytes (-0.0%) ⬇️. This is within the configured threshold ✅

Detailed changes
Bundle name Size Change
sentry-docs-server-cjs 10.2MB 9 bytes (-0.0%) ⬇️
sentry-docs-client-array-push 9.11MB 6 bytes (-0.0%) ⬇️

Copy link
Member

@Lms24 Lms24 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for clarifying this! Reads way better now than before.

}
```


Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

l: Can we also mention the last point, about HttpExceptions not being caught, below the code block just above this line? I think it's valuable information since users might expect otherwise in a catch-all filter?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would you move it in general or duplicate it?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM as you have it now

Co-authored-by: Lukas Stracke <lukas.stracke@sentry.io>
In SDK versions `8.39.0` and above, the `SentryGlobalGenericFilter` is deprecated because the `SentryGlobalFilter` will handle GraphQL contexts automatically.

By default, exceptions with status code 4xx are not sent to Sentry. If you still want to capture these exceptions, you can do so manually with `Sentry.captureException()`:
If you have error filters for specific types of exceptions (for example `@Catch(HttpException)`, or any other `@Catch(...)` with arguments) and you want to capture errors caught by these filters, capture the errors in the `catch()` handler with `Sentry.captureException()`:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this case they would also need to remove our SentryExceptionCaptured decorator, otherwise unexpected errors get captured twice right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a tricky one to think through. In general, our dedupe integration will drop the second capture call, as long as the two capture calls happen consecutively (no capture call on another error in between).

I am not sure if we should tell people to remove their SentryExceptionCaptured decorators though. The two things serve different purposes. One is more fine grained the other more blanket.

@lforst lforst merged commit 0bed01e into master Dec 5, 2024
11 checks passed
@lforst lforst deleted the lforst-nest-error-filter branch December 5, 2024 13:56
Lms24 added a commit that referenced this pull request Dec 13, 2024
Co-authored-by: Lukas Stracke <lukas.stracke@sentry.io>
@github-actions github-actions bot locked and limited conversation to collaborators Dec 21, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

NestJS SentryExeceptionCaptured doesn't catch custom filters

3 participants