def run
      Open4.popen4(pipeline) do |_pid, _stdin, stdout, stderr|
        pipestatus = stdout.read.delete("\n").split(":").sort
        pipestatus.each do |status|
          index, exitstatus = status.split("|").map(&:to_i)
          next if @success_codes[index].include?(exitstatus)
          command = command_name(@commands[index])
          @errors << SystemCallError.new(
            "'#{command}' returned exit code: #{exitstatus}", exitstatus
          )
        end
        @stderr = stderr.read.strip
      end
      Logger.warn(stderr_messages) if success? && stderr_messages
    rescue Exception => err
      raise Error.wrap(err, "Pipeline failed to execute")
    end
def run
      Open4.popen4(pipeline) do |_pid, _stdin, stdout, stderr|
        pipestatus = stdout.read.delete("\n").split(":").sort
        pipestatus.each do |status|
          index, exitstatus = status.split("|").map(&:to_i)
          next if @success_codes[index].include?(exitstatus)
          command = command_name(@commands[index])
          @errors << SystemCallError.new(
            "'#{command}' returned exit code: #{exitstatus}", exitstatus
          )
        end
        @stderr = stderr.read.strip
      end
      Logger.warn(stderr_messages) if success? && stderr_messages
    rescue Exception => err
      raise Error.wrap(err, "Pipeline failed to execute")
    end
Runs the command line from `#pipeline` and collects STDOUT/STDERR.
 STDOUT is then parsed to determine the exit status of each command.
 For each command with a non-zero exit status, a SystemCallError is
 created and added to @errors. All STDERR output is set in @stderr.

 Note that there is no accumulated STDOUT from the commands themselves.
 Also, the last command should not attempt to write to STDOUT.
 Any output on STDOUT from the final command will be sent to STDERR.
 This in itself will not cause #run to fail, but will log warnings
 when all commands exit with non-zero status.

 Use `#success?` to determine if all commands in the pipeline succeeded.
 If `#success?` returns `false`, use `#error_messages` to get an error report.