'Callback when a download error occurred.
Args:
url: The original url of the asset as QUrl.
item: The DownloadItem given by the DownloadManager.'

def _error(self, url, item, *_args):

    try:
        self.pending_downloads.remove((url, item))
    except KeyError:
        log.downloads.debug('Oops!    Download    already    gone:    {}'.format(item))
        return
    item.fileobj.actual_close()
    self.writer.add_file(urlutils.encoded_url(url), '')
    if self.pending_downloads:
        return
    self._finish_file()
