123456789_123456789_123456789_123456789_123456789_

Exception: Mongo::Auth::InvalidMechanism

Relationships & Source Files
Super Chains via Extension / Inclusion / Inheritance
Class Chain:
Instance Chain:
Inherits: Mongo::Auth::InvalidConfiguration
Defined in: lib/mongo/auth.rb

Overview

Raised when trying to get an invalid authorization mechanism.

Since:

  • 2.0.0

Class Method Summary

Instance Attribute Summary

::Mongo::Error::Notable - Included

#connection_global_id

Returns global id of the connection on which the error occurred.

#generation

Returns connection pool generation for the connection on which the error occurred.

#service_id

Returns service id for the connection on which the error occurred.

Instance Method Summary

::Mongo::Error::Notable - Included

#add_note,
#add_notes

Allows multiple notes to be added in a single call, for convenience.

#notes

Returns an array of strings with additional information about the exception.

#to_s, #notes_tail

Constructor Details

.new(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

[ GitHub ]

  
# File 'lib/mongo/auth.rb', line 121

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