feat(aiohttp): Add failed_request_status_codes#3551
Merged
szokeasaurusrex merged 2 commits intoSep 23, 2024
Conversation
Codecov ReportAttention: Patch coverage is
✅ All tests successful. No failed tests found.
Additional details and impacted files@@ Coverage Diff @@
## master #3551 +/- ##
=======================================
Coverage 84.30% 84.31%
=======================================
Files 133 133
Lines 13885 13890 +5
Branches 2929 2930 +1
=======================================
+ Hits 11706 11711 +5
Misses 1438 1438
Partials 741 741
|
2adb74e to
3ad9fa9
Compare
3ad9fa9 to
4558c9a
Compare
`failed_request_status_codes` allows users to specify the status codes, whose corresponding `HTTPException` types, should be reported to Sentry. By default, these include 5xx statuses, which is a change from the previous default behavior, where no `HTTPException`s would be reported to Sentry. Closes #3535
4558c9a to
87e4a7e
Compare
sentrivana
approved these changes
Sep 23, 2024
Contributor
sentrivana
left a comment
There was a problem hiding this comment.
LGTM
Please also add to the docs.
We should also think about what to do with the old-style failed_request_status_codes format that Starlette/FastAPI is using. We can deprecate it in favor of using a set and then do the switch with the new major.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
failed_request_status_codesallows users to specify the status codes, whose correspondingHTTPExceptiontypes, should be reported to Sentry. By default, these include 5xx statuses, which is a change from the previous default behavior, where noHTTPExceptions would be reported to Sentry.The status codes are only captured as errors if they are returned by raising an
HTTPException. If a response with one of thefailed_request_status_codesis returned, we would not report this to Sentry, as there is no exception object we can send and no easy way to create one.Closes #3535