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

socket.gaierror (dns error) is not converted to ClientConnectorError #2423

Closed
hellysmile opened this issue Oct 27, 2017 · 5 comments
Closed
Labels

Comments

@hellysmile
Copy link
Member

hellysmile commented Oct 27, 2017

Long story short

socket.gaierror should be converted to ClientConnectorError

Expected behaviour

raises ClientConnectorError

Actual behaviour

raises socket.gaierror (for threaded resolver) or OSError (for aiodns resolver)

Steps to reproduce

import aiohttp
import asyncio


async def main():
    async with aiohttp.ClientSession() as session:
        async with session.get('http://notexist.domain') as response:
            return await response.text()


loop = asyncio.get_event_loop()
loop.run_until_complete(main())

Your environment

MacOS 10.12.6
Python 3.6.2 from pyenv

@hellysmile
Copy link
Member Author

What about to extract fix for this from #2410 to separate pull request?

@achimnol
Copy link
Member

Similarly, when connecting to an invalid UNIX socket file (e.g., "/var/run/non-existent-socket.sock"), it raises FileNotFoundError which is not converted to aiohttp.ClientOSError.
(refs aio-libs/aiodocker#142)

@hellysmile
Copy link
Member Author

According to unix connector internals, it is another issue. Please submit it separetelly. It requires another fix.

@hellysmile
Copy link
Member Author

Fixed by #2442, it is not in master yet

@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
Projects
None yet
Development

No branches or pull requests

2 participants