[PR #6722/fb465e15 backport][3.10] Implement granular URL error hierarchy in the HTTP client#8158
Merged
webknjaz merged 1 commit intoaio-libs:3.10from Feb 14, 2024
Conversation
This patch introduces 5 granular user-facing exceptions that may occur when HTTP requests are made: * `InvalidUrlClientError` * `RedirectClientError` * `NonHttpUrlClientError` * `InvalidUrlRedirectClientError` * `NonHttpUrlRedirectClientError` Previously `ValueError` or `InvalidURL` was raised and screening out was complicated (a valid URL that redirects to invalid one raised the same error as an invalid URL). Ref: aio-libs#6722 (comment) PR aio-libs#6722 Resolves aio-libs#2507 Resolves aio-libs#2630 Resolves aio-libs#3315 Co-authored-by: Sviatoslav Sydorenko <[email protected]> (cherry picked from commit fb465e1)
5 tasks
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## 3.10 #8158 +/- ##
==========================================
+ Coverage 97.44% 97.46% +0.01%
==========================================
Files 108 108
Lines 32928 32997 +69
Branches 3930 3946 +16
==========================================
+ Hits 32088 32159 +71
+ Misses 637 635 -2
Partials 203 203
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
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.
This is a backport of PR #6722 as merged into master (fb465e1).
This patch introduces 5 granular user-facing exceptions that may occur
when HTTP requests are made:
InvalidUrlClientErrorRedirectClientErrorNonHttpUrlClientErrorInvalidUrlRedirectClientErrorNonHttpUrlRedirectClientErrorPreviously
ValueErrororInvalidURLwas raised and screening out wascomplicated (a valid URL that redirects to invalid one raised the same error
as an invalid URL).
Ref: #6722 (comment)
PR #6722
Resolves #2507
Resolves #2630
Resolves #3315
Co-authored-by: Sviatoslav Sydorenko [email protected]
(cherry picked from commit fb465e1)