-
-
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.Timeout causes CancelledError #930
Comments
So you are asking just for suppressing chained exception, isn't it? |
If in all cases the appearance of TimeoutError is accompanied by CancelledError, I don't think the latter is all that meaningful to appear. And if I am to catch CancelledError in my code, I'd have to distinguish between it appearing by itself or paired with a timeout. Since a timeout is a legit situation (e.g. connectivity issues), I'd like to receive only the exception associated with it, so yes, suppressing the CancelledError on timeout should solve the issue for me. |
Long story short
I use aiohttp.Timeout so that my code could react to connectivity problems and reattempt an unsuccessful connection. When timeout happens, the traceback contains more than that, misleading into a thought that something was prematurely cancelled due to other reasons.
Expected behaviour
Only asyncio.TimeoutError exception is thrown when the specified timeout expires and all other exceptions which result from it are muffled.
Actual behaviour
CancelledError exception is thrown and appears in traceback along with TimeoutError:
Steps to reproduce
Consider the simple sample:
Your environment
Python 3.5.1
aiohttp (0.21.6)
asyncio (3.4.3)
The text was updated successfully, but these errors were encountered: