I do get `socket.gaierror` for incorrect domain names like in your example but invalid IP addresses raise the `socket.error`, e.g. "999.999.999.999".

Regardless, I agree that the best approach would be an extra exception handler, logging that there has been a generic socket error.