Handling OSError for ConnectionError.