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: application_controller.rb
    path of file: ./repos/e621ng/app/controllers
    
    the code of the file until where you have to start completion: # frozen_string_literal: true

class ApplicationController < ActionController::Base
  class APIThrottled < Exception; end
  class FeatureUnavailable < StandardError; end

  skip_forgery_protection if: -> { SessionLoader.new(request).has_api_authentication? || request.options? }
  before_action :reset_current_user
  before_action :set_current_user
  before_ac
    
  def render_error_page(status, exception, message: exception.message, format: request.format.symbol)
    @exception = exception
    @expected = status < 500
    @message = message.encode("utf-8", invalid: :replace, undef: :replace )
    @backtrace = Rails.backtrace_cleaner.clean(@exception.backtrace)
    format = :html unless format.in?(%i[html json atom])

    if !CurrentUser.user.is_janitor? && message == exception.message
      @message = "An unexpected error occurred."
    end