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 · 4 comments

Comments

Projects
None yet
2 participants
@hellysmile
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

This comment has been minimized.

Member

hellysmile commented Oct 27, 2017

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

@achimnol

This comment has been minimized.

Member

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)

@hellysmile

This comment has been minimized.

Member

hellysmile commented Oct 28, 2017

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

@hellysmile

This comment has been minimized.

Member

hellysmile commented Oct 30, 2017

Fixed by #2442, it is not in master yet

@hellysmile hellysmile closed this Oct 30, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment