trying to capture socket.error exception