Skip to content

[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
setla:patchback/backports/3.10/fb465e155b872f01489173d11e35f02ccbf3a940/pr-6722
Feb 14, 2024
Merged

[PR #6722/fb465e15 backport][3.10] Implement granular URL error hierarchy in the HTTP client#8158
webknjaz merged 1 commit intoaio-libs:3.10from
setla:patchback/backports/3.10/fb465e155b872f01489173d11e35f02ccbf3a940/pr-6722

Conversation

@setla
Copy link
Copy Markdown
Contributor

@setla setla commented Feb 14, 2024

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:

  • 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: #6722 (comment)

PR #6722

Resolves #2507
Resolves #2630
Resolves #3315

Co-authored-by: Sviatoslav Sydorenko [email protected]
(cherry picked from commit fb465e1)

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)
@psf-chronographer psf-chronographer bot added the bot:chronographer:provided There is a change note present in this PR label Feb 14, 2024
@codecov
Copy link
Copy Markdown

codecov bot commented Feb 14, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (5e4f0b8) 97.44% compared to head (6b9f421) 97.46%.

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              
Flag Coverage Δ
CI-GHA 97.37% <100.00%> (+0.01%) ⬆️
OS-Linux 97.06% <100.00%> (+0.01%) ⬆️
OS-Windows 94.60% <100.00%> (+0.01%) ⬆️
OS-macOS 96.88% <100.00%> (+0.01%) ⬆️
Py-3.10.11 94.50% <100.00%> (+0.01%) ⬆️
Py-3.10.13 96.85% <100.00%> (+0.01%) ⬆️
Py-3.11.7 96.39% <100.00%> (+0.01%) ⬆️
Py-3.11.8 96.50% <100.00%> (+0.01%) ⬆️
Py-3.12.1 ?
Py-3.8.10 94.48% <100.00%> (+<0.01%) ⬆️
Py-3.8.18 96.78% <100.00%> (+0.01%) ⬆️
Py-3.9.13 94.49% <100.00%> (+0.01%) ⬆️
Py-3.9.18 96.82% <100.00%> (+0.01%) ⬆️
Py-pypy7.3.15 96.36% <100.00%> (+0.01%) ⬆️
VM-macos 96.88% <100.00%> (+0.01%) ⬆️
VM-ubuntu 97.06% <100.00%> (+0.01%) ⬆️
VM-windows 94.60% <100.00%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@webknjaz webknjaz changed the title Implement granular URL error hierarchy in the HTTP client [PR #6722/fb465e15 backport][3.10] Implement granular URL error hierarchy in the HTTP client Feb 14, 2024
@webknjaz webknjaz merged commit cda4a8b into aio-libs:3.10 Feb 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bot:chronographer:provided There is a change note present in this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants