def perform
      _check_valid_status
      begin
        _setup
        stages.each do |stage|
          stage.perform unless stage.completed?
        end
        _complete_with_status(:completed)
      rescue IrrecoverableError
        _complete_with_status(:failed)
      rescue RecoverableError => e
        if e.input_required?
          _complete_with_status(:paused)
        else
          _complete_with_status(:retry)
          raise e
        end
      rescue Exception
        _complete_with_status(failure_mode == :cancel ? :failed : :paused)
      end
    end
def perform
      _check_valid_status
      begin
        _setup
        stages.each do |stage|
          stage.perform unless stage.completed?
        end
        _complete_with_status(:completed)
      rescue IrrecoverableError
        _complete_with_status(:failed)
      rescue RecoverableError => e
        if e.input_required?
          _complete_with_status(:paused)
        else
          _complete_with_status(:retry)
          raise e
        end
      rescue Exception
        _complete_with_status(failure_mode == :cancel ? :failed : :paused)
      end
    end
Standard +delayed_job+ method called when executing this pipeline. Raises
 InvalidStatusError if pipeline is in an invalid state for execution (e.g.
 already cancelled, or completed).

 This method will be called by +delayed_job+
 if this object is enqueued for asynchronous execution. However, you could
 call this method and execute the pipeline synchronously, without relying on
 +delayed_job+. Auto-retry would not work in this case, though.