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(hapi): Specify error channel to filter boom errors #12725

Merged
merged 8 commits into from
Jul 4, 2024

Conversation

s1gr1d
Copy link
Member

@s1gr1d s1gr1d commented Jul 2, 2024

If errors are handled with Boom inside onPreResponse, the error should not be reported to Sentry.

fixes #12702

Copy link
Member

@mydea mydea left a comment

Choose a reason for hiding this comment

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

nice! Great tests, too 🚀

@camsteffen
Copy link

FWIW, I think there's another (arguably worse) version of this bug where onPreResponse recovers from the error with a 200 response.

I'm not sure it's valuable for the tests to enumerate all these possibilities though. We're just relying on Hapi to report an error on the error channel when applicable. The details of that are not Sentry's responsibility. But also I'm not a maintainer so don't mind me!

@s1gr1d
Copy link
Member Author

s1gr1d commented Jul 3, 2024

@camsteffen Thanks for you engagement in this topic! 👍🏻 I am not sure if I understood you correctly. I added a test case for a "2xx override" inside onPreResponse. In our opinion, this should not be reported to Sentry as this could be done on purpose.

@camsteffen
Copy link

I guess what I'm suggesting is - I wonder if you could have a test like does not report errors from Hapi events on "internal" channel rather than trying to have a test for every possible scenario of an error appearing on the internal channel.

@s1gr1d s1gr1d merged commit 4018f80 into develop Jul 4, 2024
114 of 115 checks passed
@s1gr1d s1gr1d deleted the sig/hapi-onPreResponse branch July 4, 2024 12:16
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.

Hapi errors are reported before onPreResponse
4 participants