aio-libs / aiodns

Simple DNS resolver for asyncio
https://pypi.python.org/pypi/aiodns
MIT License
532 stars 69 forks source link

Let DNSError inherit OSError to match with stdlib behavior #30

Closed achimnol closed 7 years ago

achimnol commented 7 years ago

Both socket.getaddrinfo and asyncio.BaseEventLoop.getaddrinfo raises OSError when a DNS lookup fails. It would be more consistent if aiodns.error.DNSError is also an instance of OSError, setting errno and stringified error message as the current implementation does.

saghul commented 7 years ago

I don't think that's a good idea. The returned errors don't necessarily match errno.