You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: error_handler.rb
    path of file: ./repos/miru-web/app/controllers/concerns
    
    the code of the file until where you have to start completion: # frozen_string_literal: true

module E
    
    def user_not_authorized(exception)
      redirect_path = root_path
      policy = exception.policy
      policy_name = policy.class.to_s.underscore
      error_key = policy.try(:error_message_key) || exception.query

      message = I18n.t("#{policy_name}.#{error_key}", scope: "pundit", default: :default)
      case policy.try(:error_message_key)
      when :different_workspace
        message = I18n.t("client.update.failure.unauthorized")
      end