Exception: Mongo::Error::UnsupportedCollation Deprecated

Inherits:
UnsupportedOption show all
Defined in:
lib/mongo/error/unsupported_collation.rb

Overview

Deprecated.

RUBY-2260 In driver version 3.0, this error class will be replaced with UnsupportedOption. To handle this error, catch Mongo::Error::UnsupportedOption, which will prevent any breaking changes in your application when upgrading to version 3.0 of the driver.

Raised if a collation is specified for an operation but the server selected does not support collations.

Since:

  • 2.4.0

Constant Summary collapse

DEFAULT_MESSAGE =

The default error message describing that collations is not supported.

Returns:

  • (String)

    A default message describing that collations is not supported by the server.

Since:

  • 2.4.0

"Collations is not a supported feature of the server handling this operation. " +
"Operation results may be unexpected."
UNACKNOWLEDGED_WRITES_MESSAGE =

The error message describing that collations cannot be used when write concern is unacknowledged.

Returns:

  • (String)

    A message describing that collations cannot be used when write concern is unacknowledged.

Since:

  • 2.4.0

"A collation cannot be specified when using unacknowledged writes. " +
"Either remove the collation option or use acknowledged writes (w >= 1)."

Constants inherited from UnsupportedOption

Mongo::Error::UnsupportedOption::ALLOW_DISK_USE_MESSAGE, Mongo::Error::UnsupportedOption::COMMIT_QUORUM_MESSAGE, Mongo::Error::UnsupportedOption::HINT_MESSAGE, Mongo::Error::UnsupportedOption::UNACKNOWLEDGED_HINT_MESSAGE

Constants inherited from Mongo::Error

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

Instance Attribute Summary

Attributes included from Notable

#connection_global_id, #generation, #service_id

Instance Method Summary collapse

Methods inherited from UnsupportedOption

allow_disk_use_error, commit_quorum_error, hint_error

Methods inherited from Mongo::Error

#change_stream_resumable?, #write_concern_error_label?, #write_concern_error_labels

Methods included from ChangeStreamResumable

#change_stream_resumable?

Methods included from WriteRetryable

#write_retryable?

Methods included from Labelable

#add_label, #label?, #labels

Methods included from Notable

#add_note, #add_notes, #notes, #to_s

Constructor Details

#initialize(message = nil) ⇒ UnsupportedCollation

Create the new exception.

Examples:

Create the new exception.

Mongo::Error::UnsupportedCollation.new

Since:

  • 2.4.0



54
55
56
# File 'lib/mongo/error/unsupported_collation.rb', line 54

def initialize(message = nil)
  super(message || DEFAULT_MESSAGE)
end