Exception: Mongoid::Errors::NoDefaultSession

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

Overview

This error is raised when a default session 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) ⇒ NoDefaultSession

Create the new error with the defined session names.

Examples:

Create the new error.

NoDefaultSession.new([ :secondary ])

Parameters:

  • keys (Array<Symbol>)

    The defined sessions.

Since:

  • 3.0.0


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

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