Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(nuxt): Ignore 300-400 status codes on app errors in Nuxt #15473

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

GerryWilko
Copy link

Before submitting a pull request, please take a look at our
Contributing guidelines and verify:

  • If you've added code that should be tested, please add tests.
  • Ensure your code lints and the test suite passes (yarn lint) & (yarn test).

Description

I noticed that Nuxt 300-400 status codes from the app are being reported to Sentry unnecessarily. There appears to be a guard against doing this on the server side errors but client side errors like 404 or 401s are being reported to Sentry.

I have simply added the same guard on the client side error reporter for the Nuxt integration of Sentry.

@GerryWilko
Copy link
Author

@s1gr1d apologies for the call out but I'm not sure how to get this reviewed. You seem to be the resident Nuxt expert at Sentry looking at previous PRs?

@lforst lforst changed the title fix(nuxt): ignore 300-400 status codes on app errors in Nuxt fix(nuxt): Ignore 300-400 status codes on app errors in Nuxt Feb 25, 2025
Copy link
Member

@lforst lforst left a comment

Choose a reason for hiding this comment

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

This seems very reasonable to me. @s1gr1d feel free to merge if this also makes sense to you!

Comment on lines +69 to +71
if (isNuxtError(error)) {
// Do not report if status code is 3xx or 4xx
if (error.statusCode >= 300 && error.statusCode < 500) {
Copy link
Member

Choose a reason for hiding this comment

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

The 2 conditions could be ANDed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants