<commit_before>class ApplicationController < ActionController::Base
  protect_from_forgery
  include SessionsHelper

  @literals = Literal.all

  #define primary_languages - if the user has not defined any languages for the product. default
  #to english and french
  @primary_languages = Language.first

  before_filter :set_locale


  rescue_from Exception do |e|
    logger.info = "#{e.message}"
    flash[:notice] = "Sorry an error occured. Please contact administrator."
    redirect_to "/" and return
  end


  def set_locale
    if signed_in?
      if session[:locale].present?

      else
        session[:locale] = current_user.locale
      end
    end

    session[:locale] = "en" unless session[:locale].present?
    I18n.locale = session[:locale]

  end
<commit_msg>Rescue from error reverted<commit_after>class ApplicationController < ActionController::Base
  protect_from_forgery
  include SessionsHelper

  @literals = Literal.all

  #define primary_languages - if the user has not defined any languages for the product. default
  #to english and french
  @primary_languages = Language.first

  before_filter :set_locale

  def set_locale
    if signed_in?
      if session[:locale].present?

      else
        session[:locale] = current_user.locale
      end
    end

    session[:locale] = "en" unless session[:locale].present?
    I18n.locale = session[:locale]

  end

{'fraction_non_alphanumeric': 0.07853025936599424, 'fraction_numerical': 0.002881844380403458, 'mean_word_length': 3.495145631067961, 'pattern_counts': {'":': 0, '<': 5, '<?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': '6189397', 'n_tokens_mistral': 413, 'n_tokens_neox': 388, 'n_words': 117}