def _handle_error(self, url, e, pack=True):
        if self.job_desc.error_handler:
            self.job_desc.error_handler.handle(e, url)
        
        self._log_error(url, e)
        retries, span, ignore = self._get_handle_error_params(e)
        if url.error_times <= retries:
            self.stopped.wait(span)
            return
        
        self._handle_proxy_network_error(e)
        
        if pack:
            content = self.opener.read()
            if content is None and isinstance(e, ServerError):
                content = e.read()
            msg = 'Error when handle url: %s' % str(url)
            self._pack_error(url, msg, e, content)
            
        if not ignore:
            self._error()
            raise UnitRetryFailed
dataset/ETHPy150Open chineking/cola/cola/job/executor.py/UrlExecutor._handle_error/original