Exception: Mongo::Auth::InvalidMechanism

Inherits:
InvalidConfiguration show all
Defined in:
build/ruby-driver-master/lib/mongo/auth.rb

Overview

Raised when trying to get an invalid authorization mechanism.

Since:

  • 2.0.0

Instance Attribute Summary

Attributes included from Error::Notable

#generation, #service_id

Instance Method Summary collapse

Methods included from Error::Notable

#add_note, #notes, #to_s

Constructor Details

#initialize(mechanism) ⇒ InvalidMechanism

Instantiate the new error.

Examples:

Instantiate the error.

Mongo::Auth::InvalidMechanism.new(:test)

Parameters:

  • mechanism (Symbol)

    The provided mechanism.

Since:

  • 2.0.0



118
119
120
121
122
123
# File 'build/ruby-driver-master/lib/mongo/auth.rb', line 118

def initialize(mechanism)
  known_mechanisms = SOURCES.keys.sort.map do |key|
    key.inspect
  end.join(', ')
  super("#{mechanism.inspect} is invalid, please use one of the following mechanisms: #{known_mechanisms}")
end