<commit_before>class SocialAccounts::BaseController < ApplicationController
  layout 'social_account_popup'

  def provider_name
    params[:provider_name]
  end

  def omniauth_obj
    request.env['omniauth.auth']
  end

  def render_trigger_event name, details
    render :'social_accounts/trigger_event', locals: {event: {name: name, details: details}}
  end

  def render_trigger_event_on_social_account_error
    yield
  rescue SocialAccountError => error
    if error.message == SocialAccountError.new.message
      render_trigger_event 'social_error', "Something went wrong"
    else
      render_trigger_event 'social_error', error.message
    end
  end

  class SocialAccountError < StandardError
  end
end<commit_msg>Better default error message per @EamonNerbonne's suggestion :D<commit_after>class SocialAccounts::BaseController < ApplicationController
  layout 'social_account_popup'

  def provider_name
    params[:provider_name]
  end

  def omniauth_obj
    request.env['omniauth.auth']
  end

  def render_trigger_event name, details
    render :'social_accounts/trigger_event', locals: {event: {name: name, details: details}}
  end

  def render_trigger_event_on_social_account_error
    yield
  rescue SocialAccountError => error
    render_trigger_event 'social_error', error.message
  end

  class SocialAccountError < StandardError
    def initialize(msg = 'Something went wrong')
      super
    end
  end
end
{'fraction_non_alphanumeric': 0.06699232379623168, 'fraction_numerical': 0.0, 'mean_word_length': 4.6015625, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 5, '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': '6643319', 'n_tokens_mistral': 421, 'n_tokens_neox': 408, 'n_words': 105}