'If feedparser reports error, save the received data and log error.'

def process_invalid_content(self, task, data, url):

    if (data is None):
        log.critical(u'Received    empty    page    -    no    content')
        return
    else:
        data = tobytes(data)
    ext = u'xml'
    if ('<html>' in data.lower()):
        log.critical(u'Received    content    is    HTML    page,    not    an    RSS    feed')
        ext = u'html'
    if (('login' in data.lower()) or ('username' in data.lower())):
        log.critical(u'Received    content    looks    a    bit    like    login    page')
    if ('error' in data.lower()):
        log.critical(u'Received    content    looks    a    bit    like    error    page')
    received = os.path.join(task.manager.config_base, u'received')
    if (not os.path.isdir(received)):
        os.mkdir(received)
    filename = task.name
    sourcename = urlparse(url).netloc
    if sourcename:
        filename += (u'-' + sourcename)
    filename = pathscrub(filename, filename=True)
    filepath = os.path.join(received, (u'%s.%s' % (filename, ext)))
    with open(filepath, u'wb') as f:
        f.write(data)
    log.critical(u'I    have    saved    the    invalid    content    to    %s    for    you    to    view', filepath)
