Raise new exception to avoid race condition on socket.error