<commit_before>module Mailgun

  class ParameterError < RuntimeError
    attr_reader :object

    def initialize(message=nil, object=nil)
      @object = object
    end
  end

  class CommunicationError < RuntimeError
    attr_reader :object

    def initialize(message=nil, object=nil)
      @object = object
    end
  end

  class ParseError < RuntimeError
    attr_reader :object

    def initialize(message=nil, object=nil)
      @object = object
    end
  end

end
<commit_msg>method to_s defined for custom error classes. Allows to propagate exception messages up<commit_after>module Mailgun

  class Error < RuntimeError
    attr_reader :object

    def initialize(message=nil, object=nil)
      @message = message
      @object = object
    end

    def to_s
      @message || self.class.to_s
    end
  end

  class ParameterError     < Error; end
  class CommunicationError < Error; end
  class ParseError         < Error; end

end

{'fraction_non_alphanumeric': 0.05951115834218916, 'fraction_numerical': 0.0, 'mean_word_length': 2.925, 'pattern_counts': {'":': 0, '<': 10, '<?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': '7132923', 'n_tokens_mistral': 275, 'n_tokens_neox': 261, 'n_words': 85}