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 Attribute Summary

Attributes inherited from MongoidError

#problem, #resolution, #summary

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([ :analytics ])

Parameters:

  • keys (Array<Symbol>)

    The defined clients.



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