123456789_123456789_123456789_123456789_123456789_

Exception: Mongo::Error::OperationFailure

Relationships & Source Files
Namespace Children
Modules:
Super Chains via Extension / Inclusion / Inheritance
Class Chain:
self, ::Mongo::Error, StandardError
Instance Chain:
Inherits: Mongo::Error
  • Object
Defined in: lib/mongo/error/operation_failure.rb

Overview

Raised when an operation fails for some reason.

Since:

  • 2.0.0

Constant Summary

::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

SdamErrorDetection - Included

NODE_RECOVERING_CODES, NODE_SHUTTING_DOWN_CODES, NOT_MASTER_CODES

ReadWriteRetryable - Included

RETRY_MESSAGES, WRITE_RETRY_ERRORS, WRITE_RETRY_MESSAGES

Family - Included

CHANGE_STREAM_RESUME_ERRORS, CHANGE_STREAM_RESUME_MESSAGES

Class Method Summary

::Mongo::Error - Inherited

Instance Attribute Summary

Family - 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?

#code, #code_name, #details, #document,
#max_time_ms_expired?

Whether the error is MaxTimeMSExpired.

#result, #server_message,
#unsupported_retryable_write?

Whether the error is caused by an attempted retryable write on a storage engine that does not support retryable writes.

#write_concern_error?, #write_concern_error_code, #write_concern_error_code_name,
#write_concern_error_document

Returns the write concern error document as it was reported by the server, if any.

#wtimeout?

Whether the error is a write concern timeout.

#change_stream_resumable_code?

ReadWriteRetryable - Included

#retryable?

Whether the error is a retryable error according to the legacy read retry logic.

#write_retryable?

Whether the error is a retryable error according to the modern retryable reads and retryable writes specifications.

#write_retryable_code?

SdamErrorDetection - Included

#node_recovering?

Whether the error is a “node is recovering” error, or one of its variants.

#node_shutting_down?

Whether the error is a “node is shutting down” type error.

#not_master?

Whether the error is a “not master” error, or one of its variants.

::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

Family - Included

#connection_description,
#initialize

Create the operation failure.

#append_details

Append the details to the message.

#retrieve_details

Retrieve the details from a document.

::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

This class inherits a constructor from Mongo::Error