Skip to content

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

Closed
@hellysmile

Description

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

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions