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

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

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

Comments

@hellysmile
Copy link
Member

@hellysmile 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

@hellysmile hellysmile commented Oct 27, 2017

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

Loading

@achimnol
Copy link
Member

@achimnol achimnol commented Oct 28, 2017

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)

Loading

@hellysmile
Copy link
Member Author

@hellysmile hellysmile commented Oct 28, 2017

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

Loading

@hellysmile
Copy link
Member Author

@hellysmile hellysmile commented Oct 30, 2017

Fixed by #2442, it is not in master yet

Loading

@lock
Copy link

@lock 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

Loading

@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
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants