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

NestErrorHandler reports error wrongly #12745

Closed
3 tasks done
Tracked by #12504
GP4cK opened this issue Jul 4, 2024 · 1 comment
Closed
3 tasks done
Tracked by #12504

NestErrorHandler reports error wrongly #12745

GP4cK opened this issue Jul 4, 2024 · 1 comment
Assignees
Labels
Package: node Issues related to the Sentry Node SDK Type: Bug

Comments

@GP4cK
Copy link

GP4cK commented Jul 4, 2024

Is there an existing issue for this?

How do you use Sentry?

Sentry Saas (sentry.io)

Which SDK are you using?

@sentry/node

SDK Version

8.13.0

Framework Version

No response

Link to Sentry event

No response

SDK Setup/Reproduction Example

No response

Steps to Reproduce

The issue is with this line:

const status_code = (exception as { status?: number }).status;

It tries to get the status of the exception by calling exception.status. However, if we follow the nestjs docs and throw exceptions, the status should be read with exception.getStatus().

Expected Result

Http errors where status is >=400 and <500 should not be reported to sentry

Actual Result

Http errors where status is >=400 and <500 are reported to sentry

@GP4cK GP4cK added the Type: Bug label Jul 4, 2024
@github-actions github-actions bot added the Package: node Issues related to the Sentry Node SDK label Jul 4, 2024
@nicohrubec nicohrubec self-assigned this Jul 4, 2024
@nicohrubec
Copy link
Contributor

Hey, this feature was only recently introduced and was not yet part of the 8.13.0 SDK release. We just released 8.14.0, which now includes the filtering. So updating to 8.14.0 should fix your issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Package: node Issues related to the Sentry Node SDK Type: Bug
Projects
Archived in project
Development

No branches or pull requests

3 participants