Sha256: e53a3829a2ce0f5d36bae2832bbdc704159908dcc8f72e2f30c4bf08fdf78a25

Contents?: true

Size: 591 Bytes

Versions: 4

Compression:

Stored size: 591 Bytes

Contents

# frozen_string_literal: true
# encoding: utf-8

module Mongoid
  module Errors

    # This error is raised when a default client is not defined.
    class NoDefaultClient < MongoidError

      # Create the new error with the defined client names.
      #
      # @example Create the new error.
      #   NoDefaultClient.new([ :secondary ])
      #
      # @param [ Array<Symbol> ] keys The defined clients.
      #
      # @since 3.0.0
      def initialize(keys)
        super(
          compose_message("no_default_client", { keys: keys.join(", ") })
        )
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
mongoid-7.1.2 lib/mongoid/errors/no_default_client.rb
mongoid-7.1.1 lib/mongoid/errors/no_default_client.rb
mongoid-7.1.0 lib/mongoid/errors/no_default_client.rb
mongoid-7.1.0.rc0 lib/mongoid/errors/no_default_client.rb