<commit_before>class ApplicationController < ActionController::API
  include ActionController::ImplicitRender
  include ActionView::Layouts

  rescue_from ActiveRecord::RecordNotFound, :with => :record_not_found
  rescue_from ActionController::ParameterMissing, :with => :poorly_formed_request

  private
  def record_not_found(error)
    render json: { error: error.message }, status: 404
  end

  def poorly_formed_request(error)
    render json: { error: error.message }, status: 400
  end
end<commit_msg>better name for error catching method<commit_after>class ApplicationController < ActionController::API
  include ActionController::ImplicitRender
  include ActionView::Layouts

  rescue_from ActiveRecord::RecordNotFound, :with => :record_not_found
  rescue_from ActionController::ParameterMissing, :with => :paramenter_missing

  private
  def record_not_found(error)
    render json: { error: error.message }, status: 404
  end

  def paramenter_missing(error)
    render json: { error: error.message }, status: 400
  end
end
{'fraction_non_alphanumeric': 0.08123791102514506, 'fraction_numerical': 0.01160541586073501, 'mean_word_length': 5.9, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, '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': '2753425', 'n_tokens_mistral': 297, 'n_tokens_neox': 281, 'n_words': 74}