Skip to content
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

Handle all concurrent.futures._base.TimeoutError and throw a aiohttp.errors.TimeoutError instead. #1207

Closed
AraHaan opened this issue Sep 22, 2016 · 7 comments
Labels
invalid This doesn't seem right outdated

Comments

@AraHaan
Copy link
Contributor

AraHaan commented Sep 22, 2016

Long story short

This is better to explain with the full Traceback:

Ignoring exception caused at _resolve_edit_method_code:
Traceback (most recent call last):
  File "E:\Users\Elsword\Desktop\DecoraterBot\Async\\resources\Dependencies\DecoraterBotCore\Ignore.py", line 630, in resolve_edit_method_code
    yield from DBLogs.send_edit_logs(client, before, after)
  File "E:\Users\Elsword\Desktop\DecoraterBot\Async\\resources\Dependencies\DecoraterBotCore\BotLogs.py", line 523, in send_edit_logs
    yield from self.bot.send_edit_logs_code(client, before, after)
  File "E:\Users\Elsword\Desktop\DecoraterBot\Async\\resources\Dependencies\DecoraterBotCore\BotLogs.py", line 263, in send_edit_logs_code
    yield from client.send_message(discord.Object(id='153055192873566208'), sendeditlogs)
  File "discord\client.py", line 834, in send_message
  File "discord\http.py", line 105, in request
  File "E:\Users\Elsword\Desktop\DecoraterBot\Async\\resources\Dependencies\win32-deps\3.5\aiohttp\client.py", line 555, in __iter__
    resp = yield from self._coro
  File "E:\Users\Elsword\Desktop\DecoraterBot\Async\\resources\Dependencies\win32-deps\3.5\aiohttp\client.py", line 198, in _request
    conn = yield from self._connector.connect(req)
  File "async_timeout\__init__.py", line 44, in __exit__
concurrent.futures._base.TimeoutError

Expected behaviour

To Throw a aiohttp.errors.TimeoutError instead of a concurrent.futures._base.TimeoutError on
File "aiohttp\client.py", line 198, in _request conn = yield from self._connector.connect(req)

Actual behaviour

Line 198 thows a concurrent.futures._base.TimeoutError making it hard to handle if you do not want to import concurrent just to handle the exceptions from it.

Steps to reproduce

Something that used to exist but does not anymore so when it tries to connect for x time it throws this.

Your environment

Windows 7 Ultimate x64
Python 3.5.2 (embedded) (I Insalled aiohttp (latest 1.0.2) with a installed version but use the embedded one because I can 😛)

@asvetlov
Copy link
Member

Nothing to fix: asyncio.TimeoutError and aiohttp.errors.TimeoutError are both aliases for concurrent.futures._base.TimeoutError.

@asvetlov asvetlov added the invalid This doesn't seem right label Sep 24, 2016
@hustshawn
Copy link

So how to solve the issue?

@asvetlov
Copy link
Member

You should catch asyncio.TimeoutError

@EFF
Copy link

EFF commented Dec 14, 2017

I can confirm on python 3.6 and aiohttp latest, the error doesn't get caught with except asyncio.TimeoutError as exception handling ..

@asvetlov
Copy link
Member

@EFF I don't follow, what error is not caught?
Latest aiohttp has no aiohttp.errors module.

@EFF
Copy link

EFF commented Dec 15, 2017

@asvetlov You're totally right I wasn't on latest. Thanks for the quick answer, sorry for the inconvenience.

@lock
Copy link

lock bot commented Oct 28, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a [new issue] for related bugs.
If you feel like there's important points made in this discussion, please include those exceprts into that [new issue].
[new issue]: https://github.com/aio-libs/aiohttp/issues/new

@lock lock bot added the outdated label Oct 28, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Oct 28, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
invalid This doesn't seem right outdated
Projects
None yet
Development

No branches or pull requests

4 participants