'Forces the task instance\'s state to FAILED in the database.'

@provide_session
def error(self, session=None):

    logging.error(u'Recording    the    task    instance    as    FAILED')
    self.state = State.FAILED
    session.merge(self)
    session.commit()
