Class: Mongo::Error::InvalidReadOption

Inherits:
Error
  • Object
show all
Defined in:
lib/mongo/error/invalid_read_option.rb

Overview

Exception that is raised when trying to create a client with an invalid read option.

Since:

  • 2.6.0

Instance Method Summary collapse

Constructor Details

#initialize(_read_option, msg) ⇒ InvalidReadOption

Instantiate the new exception.

The value is not included in the message: it may come from the connection string and can contain text the user intended as a credential.

Examples:

Instantiate the exception.

Mongo::Error::InvalidReadOption.new({:mode => 'bogus'})

Parameters:

  • _read_option (Object) —

    The provided read option.

  • msg (String) —

    Description of the problem.

Since:

  • 2.6.0



37
38
39
# File 'lib/mongo/error/invalid_read_option.rb', line 37

def initialize(_read_option, msg)
  super("Invalid read preference value: #{msg}")
end