@provide_session
    def error(self, session=None):
        """
        Forces the task instance's state to FAILED in the database.
        """