Exception: Mongoid::Errors::NoDefaultClient

Inherits:
MongoidError
  • Object
show all
Defined in:
lib/mongoid/errors/no_default_client.rb

Overview

This error is raised when a default client is not defined.

Constant Summary

Constants inherited from MongoidError

MongoidError::BASE_KEY

Instance Method Summary collapse

Methods inherited from MongoidError

#compose_message

Constructor Details

#initialize(keys) ⇒ NoDefaultClient

Create the new error with the defined client names.

Examples:

Create the new error.

NoDefaultClient.new([ :secondary ])

Parameters:

  • keys (Array<Symbol>)

    The defined clients.

Since:

  • 3.0.0



16
17
18
19
20
# File 'lib/mongoid/errors/no_default_client.rb', line 16

def initialize(keys)
  super(
    compose_message("no_default_client", { keys: keys.join(", ") })
  )
end