Exception: Mongo::Auth::InvalidMechanism
Relationships & Source Files | |
Super Chains via Extension / Inclusion / Inheritance | |
Class Chain:
self,
InvalidConfiguration ,
::Mongo::Error::AuthError ,
RuntimeError
|
|
Instance Chain:
|
|
Inherits: |
Mongo::Auth::InvalidConfiguration
|
Defined in: | lib/mongo/auth.rb |
Overview
Raised when trying to get an invalid authorization mechanism.
Class Method Summary
-
.new(mechanism) ⇒ InvalidMechanism
constructor
Instantiate the new error.
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.
# 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