class Airbrake::Rack::User

def self.try_current_user(rack_env)

def self.try_current_user(rack_env)
  controller = rack_env['action_controller.instance']
  return unless controller.respond_to?(:current_user, true)
  return unless [-1, 0].include?(controller.method(:current_user).arity)
  begin
    controller.__send__(:current_user)
  rescue Exception => _e # rubocop:disable Lint/RescueException
    nil
  end
end