Exception: Mongo::Error
- Inherits:
-
StandardError
- Object
- StandardError
- Mongo::Error
- Defined in:
- lib/mongo/error.rb,
lib/mongo/error/parser.rb,
lib/mongo/error/lint_error.rb,
lib/mongo/error/invalid_uri.rb,
lib/mongo/error/invalid_file.rb,
lib/mongo/error/socket_error.rb,
lib/mongo/error/closed_stream.rb,
lib/mongo/error/invalid_nonce.rb,
lib/mongo/error/max_bson_size.rb,
lib/mongo/error/file_not_found.rb,
lib/mongo/error/no_srv_records.rb,
lib/mongo/error/invalid_session.rb,
lib/mongo/error/write_retryable.rb,
lib/mongo/error/bulk_write_error.rb,
lib/mongo/error/extra_file_chunk.rb,
lib/mongo/error/invalid_document.rb,
lib/mongo/error/max_message_size.rb,
lib/mongo/error/multi_index_drop.rb,
lib/mongo/error/invalid_signature.rb,
lib/mongo/error/mismatched_domain.rb,
lib/mongo/error/operation_failure.rb,
lib/mongo/error/invalid_txt_record.rb,
lib/mongo/error/missing_file_chunk.rb,
lib/mongo/error/invalid_read_option.rb,
lib/mongo/error/need_primary_server.rb,
lib/mongo/error/no_server_available.rb,
lib/mongo/error/unexpected_response.rb,
lib/mongo/error/missing_resume_token.rb,
lib/mongo/error/socket_timeout_error.rb,
lib/mongo/error/unknown_payload_type.rb,
lib/mongo/error/unsupported_features.rb,
lib/mongo/error/invalid_database_name.rb,
lib/mongo/error/invalid_file_revision.rb,
lib/mongo/error/invalid_min_pool_size.rb,
lib/mongo/error/invalid_write_concern.rb,
lib/mongo/error/unsupported_collation.rb,
lib/mongo/error/invalid_bulk_operation.rb,
lib/mongo/error/change_stream_resumable.rb,
lib/mongo/error/invalid_collection_name.rb,
lib/mongo/error/invalid_update_document.rb,
lib/mongo/error/unexpected_chunk_length.rb,
lib/mongo/error/invalid_application_name.rb,
lib/mongo/error/unsupported_message_type.rb,
lib/mongo/error/invalid_server_preference.rb,
lib/mongo/error/unsupported_array_filters.rb,
lib/mongo/error/invalid_bulk_operation_type.rb,
lib/mongo/error/failed_stringprep_validation.rb,
lib/mongo/error/insufficient_iteration_count.rb,
lib/mongo/error/invalid_replacement_document.rb,
lib/mongo/error/invalid_transaction_operation.rb,
lib/mongo/error/unchangeable_collection_option.rb
Overview
Base error class for all Mongo related errors.
Direct Known Subclasses
BulkWriteError, ClosedStream, ExtraFileChunk, FailedStringPrepValidation, FileNotFound, InsufficientIterationCount, InvalidApplicationName, InvalidBulkOperation, InvalidBulkOperationType, InvalidCollectionName, InvalidDatabaseName, InvalidDocument, InvalidFile, InvalidFileRevision, InvalidMinPoolSize, InvalidNonce, InvalidReadOption, InvalidReplacementDocument, InvalidServerPreference, InvalidSession, InvalidSignature, InvalidTXTRecord, InvalidTransactionOperation, InvalidURI, InvalidUpdateDocument, InvalidWriteConcern, LintError, MaxBSONSize, MaxMessageSize, MismatchedDomain, MissingFileChunk, MissingResumeToken, MultiIndexDrop, NeedPrimaryServer, NoSRVRecords, NoServerAvailable, OperationFailure, SocketError, SocketTimeoutError, UnchangeableCollectionOption, UnexpectedChunkLength, UnexpectedResponse, UnknownPayloadType, UnsupportedArrayFilters, UnsupportedCollation, UnsupportedFeatures, UnsupportedMessageType
Defined Under Namespace
Modules: ChangeStreamResumable, WriteRetryable Classes: BulkWriteError, ClosedStream, ExtraFileChunk, FailedStringPrepValidation, FileNotFound, InsufficientIterationCount, InvalidApplicationName, InvalidBulkOperation, InvalidBulkOperationType, InvalidCollectionName, InvalidDatabaseName, InvalidDocument, InvalidFile, InvalidFileRevision, InvalidMinPoolSize, InvalidNonce, InvalidReadOption, InvalidReplacementDocument, InvalidServerPreference, InvalidSession, InvalidSignature, InvalidTXTRecord, InvalidTransactionOperation, InvalidURI, InvalidUpdateDocument, InvalidWriteConcern, LintError, MaxBSONSize, MaxMessageSize, MismatchedDomain, MissingFileChunk, MissingResumeToken, MultiIndexDrop, NeedPrimaryServer, NoSRVRecords, NoServerAvailable, OperationFailure, Parser, SocketError, SocketTimeoutError, UnchangeableCollectionOption, UnexpectedChunkLength, UnexpectedResponse, UnknownPayloadType, UnsupportedArrayFilters, UnsupportedCollation, UnsupportedFeatures, UnsupportedMessageType
Constant Summary collapse
- CODE =
The error code field.
'code'.freeze
- ERR =
An error field, MongoDB < 2.6
'$err'.freeze
- ERROR =
An error field, MongoDB < 2.4
'err'.freeze
- ERRMSG =
The standard error message field, MongoDB 3.0+
'errmsg'.freeze
- WRITE_ERRORS =
The constant for the writeErrors array.
'writeErrors'.freeze
- WRITE_CONCERN_ERROR =
The constant for a write concern error.
'writeConcernError'.freeze
- WRITE_CONCERN_ERRORS =
The constant for write concern errors.
'writeConcernErrors'.freeze
- UNKNOWN_ERROR =
Constant for an unknown error.
8.freeze
- BAD_VALUE =
Constant for a bad value error.
2.freeze
- CURSOR_NOT_FOUND =
Constant for a Cursor not found error.
'Cursor not found.'- UNKNOWN_TRANSACTION_COMMIT_RESULT_LABEL =
Error label describing commitTransaction errors that may or may not occur again if a commit is manually retried by the user.
'UnknownTransactionCommitResult'.freeze
- TRANSIENT_TRANSACTION_ERROR_LABEL =
Error label describing errors that will likely not occur if a transaction is manually retried from the start.
'TransientTransactionError'.freeze
Instance Method Summary collapse
-
#change_stream_resumable? ⇒ true, false
Can the change stream on which this error occurred be resumed, provided the operation that triggered this error was a getMore?.
-
#initialize(msg = nil) ⇒ Error
constructor
A new instance of Error.
-
#label?(label) ⇒ true, false
Does the error have the given label?.
Constructor Details
#initialize(msg = nil) ⇒ Error
Returns a new instance of Error.
98 99 100 101 |
# File 'lib/mongo/error.rb', line 98 def initialize(msg = nil) @labels = [] super(msg) end |
Instance Method Details
#change_stream_resumable? ⇒ true, false
Can the change stream on which this error occurred be resumed, provided the operation that triggered this error was a getMore?
82 83 84 |
# File 'lib/mongo/error.rb', line 82 def change_stream_resumable? false end |
#label?(label) ⇒ true, false
Does the error have the given label?
113 114 115 |
# File 'lib/mongo/error.rb', line 113 def label?(label) @labels.include?(label) end |