Exception: Mongoid::Errors::NoDefaultClient

Inherits:
MongoidError
  • Object
show all
Defined in:
build/mongoid-7.3/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.

Since:

  • 3.0.0



18
19
20
21
22
# File 'build/mongoid-7.3/lib/mongoid/errors/no_default_client.rb', line 18

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