<commit_before>class Importers::WaveUpdater < Importers::CompetitionDataImporter
  def process(processor)
    unless processor.valid_file?
      @errors = processor.errors
      return false
    end

    rows = processor.file_contents
    self.num_rows_processed = 0
    @errors = []

    begin
      TimeResult.transaction do
        rows.each do |row|
          row_hash = processor.process_row(row)
          competitor = competition.competitors.where(lowest_member_bib_number: row_hash[:bib_number]).first

          if competitor.nil?
            @errors << "Unable to find competitor #{row_hash[:bib_number]}"
            raise ActiveRecord::Rollback
          end

          competitor.update_attribute(:wave, row_hash[:wave])
          self.num_rows_processed += 1
        end
      end
    rescue ActiveRecord::RecordInvalid, RuntimeError => invalid
      @errors << "Error #{invalid}"
      return false
    end
  end
end
<commit_msg>update error message<commit_after>class Importers::WaveUpdater < Importers::CompetitionDataImporter
  def process(processor)
    unless processor.valid_file?
      @errors = processor.errors
      return false
    end

    rows = processor.file_contents
    self.num_rows_processed = 0
    @errors = []

    begin
      TimeResult.transaction do
        rows.each do |row|
          row_hash = processor.process_row(row)
          competitor = competition.competitors.where(lowest_member_bib_number: row_hash[:bib_number]).first

          if competitor.nil?
            @errors << "Unable to find competitor #{row_hash[:bib_number]}"
            raise ActiveRecord::Rollback
          end

          competitor.update_attribute(:wave, row_hash[:wave])
          self.num_rows_processed += 1
        end
      end
    rescue ActiveRecord::RecordInvalid, RuntimeError => invalid
      @errors << "Error #{invalid.message}"
      return false
    end
  end
end

{'fraction_non_alphanumeric': 0.08460325801366264, 'fraction_numerical': 0.0021019442984760903, 'mean_word_length': 2.6615384615384614, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2348665', 'n_tokens_mistral': 539, 'n_tokens_neox': 518, 'n_words': 116}