-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
aiohttp.errors is gone #1753
Comments
yeah it sucks not being able to handle aiohttp exceptions if you wanted to. Unless I pull an hack and do this
|
|
Except when you want to handle aiohttp exceptions in another library (discord.py is one of those libraries) to know when you get an 200, 404, or w/e error code it returns or when the request was bad / invalid. They also use |
Fixes: AttributeError: module 'aiohttp' has no attribute 'errors' aio-libs/aiohttp#1753
@jwilk updated are updated |
@fafhrd91 if your code raises those errors, why shouldn't we import them directly so we can catch them? |
Something like this should be enough: try:
yield from aiohttp.request()
except aiohttp.ClientError as err:
print(err) |
Long story short
The
aiohttp.errors
module used to be public, documented API.Now it's gone.
If this backwards-incompatible change is intentional, then it should be documented.
Steps to reproduce
Your environment
aiohttp 2.0.3
The text was updated successfully, but these errors were encountered: