Class: Mongo::Error::InvalidServerPreference

Inherits:
Error
  • Object
show all
Defined in:
lib/mongo/error/invalid_server_preference.rb

Overview

Raised when an invalid server preference is provided.

Since:

  • 2.0.0

Constant Summary collapse

NO_TAG_SUPPORT =

Error message when tags are specified for a read preference that cannot support them.

Since:

  • 2.4.0

'This read preference cannot be combined with tags.'
NO_MAX_STALENESS_SUPPORT =

Error message when a max staleness is specified for a read preference that cannot support it.

Since:

  • 2.4.0

'max_staleness cannot be set for this read preference.'
NO_HEDGE_SUPPORT =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

Deprecated.

Hedged reads are deprecated in MongoDB Server 8.0 and will be removed in a future version.

Error message when hedge is specified for a read preference that does not support it.

Since:

  • 2.0.0

'The hedge option cannot be set for this read preference'
INVALID_MAX_STALENESS =
Deprecated.

Error message for when the max staleness is not at least twice the heartbeat frequency.

Since:

  • 2.4.0

'`max_staleness` value is too small. It must be at least ' +
"`ServerSelector::SMALLEST_MAX_STALENESS_SECONDS` and (the cluster's heartbeat_frequency " +
'setting + `Cluster::IDLE_WRITE_PERIOD_SECONDS`).'

Instance Method Summary collapse

Constructor Details

#initialize(message) ⇒ InvalidServerPreference

Instantiate the new exception.

Examples:

Instantiate the exception.

Mongo::Error::InvalidServerPreference.new

Parameters:

  • message (String)

    The error message.

Since:

  • 2.0.0



57
58
59
# File 'lib/mongo/error/invalid_server_preference.rb', line 57

def initialize(message)
  super
end