<commit_before>class ApplicationController < ActionController::Base
  # Prevent CSRF attacks by raising an exception.
  # For APIs, you may want to use :null_session instead.
  protect_from_forgery with: :exception
end<commit_msg>adicionadas tratativas de erros em ApplicationController<commit_after>class ApplicationController < ActionController::Base
  # Prevent CSRF attacks by raising an exception.
  # For APIs, you may want to use :null_session instead.
  protect_from_forgery with: :null_session
  rescue_from ActiveRecord::RecordNotFound, :with => :record_not_found
  rescue_from ActionController::ParameterMissing, :with => :parameter_missing
  rescue_from ActiveModel::ForbiddenAttributesError, :with => :forbidden_attributes_error

private
  def record_not_found
    render json: {message: "record_not_found"}, status: 400
  end

  def parameter_missing
    render json: {message: "parameter_missing"}, status: 400
  end

  def forbidden_attributes_error
    render json: {message: "forbidden_attributes_error"}, status: 400
  end
end
{'fraction_non_alphanumeric': 0.06985645933014355, 'fraction_numerical': 0.00861244019138756, 'mean_word_length': 6.0675675675675675, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 6, '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': '7137655', 'n_tokens_mistral': 298, 'n_tokens_neox': 287, 'n_words': 90}