Exception: Mongo::Error::InvalidServerPreference
| Relationships & Source Files | |
| Super Chains via Extension / Inclusion / Inheritance | |
|
Class Chain:
self,
::Mongo::Error,
StandardError
|
|
|
Instance Chain:
|
|
| Inherits: |
Mongo::Error
|
| Defined in: | lib/mongo/error/invalid_server_preference.rb |
Overview
Raised when an invalid server preference is provided.
Constant Summary
-
INVALID_MAX_STALENESS =
# File 'lib/mongo/error/invalid_server_preference.rb', line 45Deprecated.
::Mongo::Errormessage for when the max staleness is not at least twice the heartbeat frequency."`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`).".freeze
-
NO_HEDGE_SUPPORT =
Internal use only
# File 'lib/mongo/error/invalid_server_preference.rb', line 39
::Mongo::Errormessage when hedge is specified for a read preference that does not support it.'The hedge option cannot be set for this read preference'.freeze
-
NO_MAX_STALENESS_SUPPORT =
# File 'lib/mongo/error/invalid_server_preference.rb', line 34
::Mongo::Errormessage when a max staleness is specified for a read preference that cannot support it.'max_staleness cannot be set for this read preference.'.freeze
-
NO_MAX_STALENESS_WITH_LEGACY_SERVER =
# File 'lib/mongo/error/invalid_server_preference.rb', line 52
::Mongo::Errormessage when max staleness cannot be used because one or more servers has version < 3.4.'max_staleness can only be set for a cluster in which ' + 'each server is at least version 3.4.'.freeze
-
NO_TAG_SUPPORT =
# File 'lib/mongo/error/invalid_server_preference.rb', line 29
::Mongo::Errormessage when tags are specified for a read preference that cannot support them.'This read preference cannot be combined with tags.'.freeze
::Mongo::Error - Inherited
BAD_VALUE, CODE, CURSOR_NOT_FOUND, ERR, ERRMSG, ERROR, TRANSIENT_TRANSACTION_ERROR_LABEL, UNKNOWN_ERROR, UNKNOWN_TRANSACTION_COMMIT_RESULT_LABEL, WRITE_CONCERN_ERROR, WRITE_CONCERN_ERRORS, WRITE_ERRORS
Class Method Summary
-
.new(message) ⇒ InvalidServerPreference
constructor
Instantiate the new exception.
::Mongo::Error - Inherited
Instance Attribute Summary
::Mongo::Error - Inherited
| #change_stream_resumable? | Can the change stream on which this error occurred be resumed, provided the operation that triggered this error was a getMore? |
| #network_error? | |
ChangeStreamResumable - Included
| #change_stream_resumable? | Can the change stream on which this error occurred be resumed, provided the operation that triggered this error was a getMore? |
WriteRetryable - Included
Notable - Included
| #connection_global_id | Returns global id of the connection on which the error occurred. |
| #generation | Returns connection pool generation for the connection on which the error occurred. |
| #service_id | Returns service id for the connection on which the error occurred. |
Instance Method Summary
::Mongo::Error - Inherited
| #write_concern_error_label? | Does the write concern error have the given label? |
| #write_concern_error_labels | The set of error labels associated with the write concern error. |
Labelable - Included
| #add_label | Adds the specified label to the error instance, if the label is not already in the set of labels. |
| #label? | Does the error have the given label? |
| #labels | Gets the set of labels associated with the error. |
Notable - Included
| #add_note, | |
| #add_notes | Allows multiple notes to be added in a single call, for convenience. |
| #notes | Returns an array of strings with additional information about the exception. |
| #to_s, #notes_tail | |
Constructor Details
.new(message) ⇒ InvalidServerPreference
Instantiate the new exception.
# File 'lib/mongo/error/invalid_server_preference.rb', line 63
def initialize() super() end