-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Implement a better way of handling non-HTTP urls in client.ClientSession #2507
Comments
I'm going to close the issue |
I propose that we either reopen this or create a new issue with the goal to create a better exception than |
@berislavlopac the problem is that nobody has time to implement it. Are you willing to send a PR? |
I'm certainly willing, I'll try to make some time. Just could use some guidance on which type of error would be most appropriate here -- my guess would be |
|
Sorry, closed accidentally. |
@berislavlopac sounds great! Let's try out what you suggest and then have a discussion in the PR :) |
@berislavlopac maybe call it |
It should have some attribute with |
(however I'm not sure — maybe such helper should go to the |
Any chance this will be implemented? aiohttp doesn't support this kind of URL either: |
@mjdubell feel free to submit a PR. |
I'm due an apology for not implementing it even though I said I will. Life intervened, and I have recently moved away from |
This comment was marked as off-topic.
This comment was marked as off-topic.
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]>
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)
…rchy in the HTTP client (#8158) **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)
Long story short
This is a follow-up for #2479 (comment).
Currently, if one uses
ClientSession
and it reaches URL with custom schema the exception with insufficient metadata is being raised.Expected behaviour
There should be some way to give control back to the caller once we reach valid URL, which we cannot follow because of unsupported schema. @asvetlov suggested to implement a custom exception for this.
Actual behaviour
Steps to reproduce
Query
https://steamcommunity.com/mobileconf/conf
orsteammobile://lostauth/
, ortwitter://webknjaz
The text was updated successfully, but these errors were encountered: