def METHOD_NAME(self, entry, reason=None, config=None, **kwargs):
    """Adds entry to internal failed list, displayed with --failed"""
    # Make sure reason is a string, in case it is set to an exception instance
    reason = str(reason) or 'Unknown'
    with Session() as session:
        # query item's existence
        item = (
            session.query(db.FailedEntry)
            .filter(db.FailedEntry.title == entry['title'])
            .filter(db.FailedEntry.url == entry['original_url'])
            .first()
        )
        if not item:
            item = db.FailedEntry(entry['title'], entry['original_url'], reason)
            item.count = 0
        if item.count > FAIL_LIMIT:
            logger.error(
                "entry with title '{}' has failed over {} times", entry['title'], FAIL_LIMIT
            )
            return
        retry_time = self.retry_time(item.count, config)
        item.retry_time = datetime.now() + retry_time
        item.count += 1
        item.tof = datetime.now()
        item.reason = reason
        session.merge(item)
        logger.debug('Marking {} in failed list. Has failed {} times.', item.title, item.count)
        if item.count <= config['max_retries']:
            plugin.get('backlog', self).add_backlog(
                entry.task, entry, amount=retry_time, session=session
            )
        entry.task.rerun(plugin='retry_failed')