<commit_before>module Spree
  Order.class_eval do
    has_one :tracking

    after_create :generate_tracking

    def last_delivery_state
      generate_tracking if tracking.nil?
      set_delivery_state if tracking.state.nil? or tracking.state.blank?
      tracking.last_delivery_state
    end

    def set_delivery_state
      generate_tracking if tracking.nil?
      return if tracking.complete?
      tracking.set_delivery_state
    end

    private

    def generate_tracking
      self.tracking = Spree::Tracking.new
    end
  end
end<commit_msg>catch error<commit_after>module Spree
  Order.class_eval do
    has_one :tracking

    after_create :generate_tracking

    def last_delivery_state
      begin
        generate_tracking if tracking.nil?
        set_delivery_state if tracking.state.nil? or tracking.state.blank?
        tracking.last_delivery_state
      rescue
      end
    end

    def set_delivery_state
      begin
        generate_tracking if tracking.nil?
        return if tracking.complete?
        tracking.set_delivery_state
      rescue
      end
    end

    private

    def generate_tracking
      self.tracking = Spree::Tracking.new
    end
  end
end
{'fraction_non_alphanumeric': 0.04222972972972973, 'fraction_numerical': 0.0, 'mean_word_length': 2.590909090909091, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '4494089', 'n_tokens_mistral': 360, 'n_tokens_neox': 339, 'n_words': 82}