<commit_before>module GnipApi
  class Response
    attr_reader :body, :headers, :status, :request
    
    def initialize request, status, body, headers
      @status = status
      @body = body
      @headers = headers
      @request = request
    end

    def ok?
      @status == 200
    end

    def error_message
      if @body
        parsed = JSON.parse(body)
        return parsed['error']['message'] if parsed['error']
      end
      return nil
    end
  end
end<commit_msg>Fixed bug in response class<commit_after>module GnipApi
  class Response
    attr_reader :body, :headers, :status, :request
    
    def initialize request, status, body, headers
      @status = status
      @body = body
      @headers = headers
      @request = request
    end

    def ok?
      @status == 200
    end

    def error_message
      if @body
        parsed = JSON.parse(@body)
        return parsed['error']['message'] if parsed['error']
      end
      return nil
    end
  end
end
{'fraction_non_alphanumeric': 0.08646998982706001, 'fraction_numerical': 0.006103763987792472, 'mean_word_length': 2.143769968051118, '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': '779380', 'n_tokens_mistral': 289, 'n_tokens_neox': 278, 'n_words': 93}