예외: Mongo::Error

상속:
StandardError
  • 객체
모두 표시
다음을 포함합니다.
ChangeStreamResumable, Labelable, Notable, WriteRetryable
다음에 정의됨:
build/ruby-driver-v2.19/lib/mongo/error.rb,
build/ruby-driver-v2.19/lib/mongo/error/parser.rb,
build/ruby-driver-v2.19/lib/mongo/error/notable.rb,
build/ruby-driver-v2.19/lib/mongo/error/kms_error.rb,
build/ruby-driver-v2.19/lib/mongo/error/labelable.rb,
build/ruby-driver-v2.19/lib/mongo/error/auth_error.rb,
build/ruby-driver-v2.19/lib/mongo/error/lint_error.rb,
build/ruby-driver-v2.19/lib/mongo/error/pool_error.rb,
build/ruby-driver-v2.19/lib/mongo/error/crypt_error.rb,
build/ruby-driver-v2.19/lib/mongo/error/invalid_uri.rb,
build/ruby-driver-v2.19/lib/mongo/error/invalid_file.rb,
build/ruby-driver-v2.19/lib/mongo/error/socket_error.rb,
build/ruby-driver-v2.19/lib/mongo/error/client_closed.rb,
build/ruby-driver-v2.19/lib/mongo/error/closed_stream.rb,
build/ruby-driver-v2.19/lib/mongo/error/invalid_nonce.rb,
build/ruby-driver-v2.19/lib/mongo/error/max_bson_size.rb,
build/ruby-driver-v2.19/lib/mongo/error/session_ended.rb,
build/ruby-driver-v2.19/lib/mongo/error/file_not_Found.rb,
build/ruby-driver-v2.19/lib/mongo/error/no_srv_records.rb,
build/ruby-driver-v2.19/lib/mongo/error/handshake_error.rb,
build/ruby-driver-v2.19/lib/mongo/error/invalid_address.rb,
build/ruby-driver-v2.19/lib/mongo/error/invalid_session.rb,
build/ruby-driver-v2.19/lib/mongo/error/write_retryable.rb,
build/ruby-driver-v2.19/lib/mongo/error/bulk_write_error.rb,
build/ruby-driver-v2.19/lib/mongo/error/extra_file_chunk.rb,
build/ruby-driver-v2.19/lib/mongo/error/invalid_document.rb,
build/ruby-driver-v2.19/lib/mongo/error/max_message_size.rb,
build/ruby-driver-v2.19/lib/mongo/error/missing_password.rb,
build/ruby-driver-v2.19/lib/mongo/error/multi_index_drop.rb,
build/ruby-driver-v2.19/lib/mongo/error/unmet_dependency.rb,
build/ruby-driver-v2.19/lib/mongo/error/invalid_signature.rb,
build/ruby-driver-v2.19/lib/mongo/error/mismatched_domain.rb,
build/ruby-driver-v2.19/lib/mongo/error/operation_failure.rb,
build/ruby-driver-v2.19/lib/mongo/error/pool_closed_error.rb,
build/ruby-driver-v2.19/lib/mongo/error/pool_paused_error.rb,
build/ruby-driver-v2.19/lib/mongo/error/server_not_usable.rb,
build/ruby-driver-v2.19/lib/mongo/error/invalid_txt_record.rb,
build/ruby-driver-v2.19/lib/mongo/error/missing_connection.rb,
build/ruby-driver-v2.19/lib/mongo/error/missing_file_chunk.rb,
build/ruby-driver-v2.19/lib/mongo/error/missing_service_id.rb,
build/ruby-driver-v2.19/lib/mongo/error/pool_cleared_error.rb,
build/ruby-driver-v2.19/lib/mongo/error/unsupported_option.rb,
build/ruby-driver-v2.19/lib/mongo/error/connection_perished.rb,
build/ruby-driver-v2.19/lib/mongo/error/invalid_read_option.rb,
build/ruby-driver-v2.19/lib/mongo/error/need_primary_server.rb,
build/ruby-driver-v2.19/lib/mongo/error/no_server_available.rb,
build/ruby-driver-v2.19/lib/mongo/error/server_api_conflict.rb,
build/ruby-driver-v2.19/lib/mongo/error/unexpected_response.rb,
build/ruby-driver-v2.19/lib/mongo/error/invalid_read_concern.rb,
build/ruby-driver-v2.19/lib/mongo/error/missing_resume_token.rb,
build/ruby-driver-v2.19/lib/mongo/error/raise_original_error.rb,
build/ruby-driver-v2.19/lib/mongo/error/read_write_retryable.rb,
build/ruby-driver-v2.19/lib/mongo/error/sdam_error_Detection.rb,
build/ruby-driver-v2.19/lib/mongo/error/socket_timeout_error.rb,
build/ruby-driver-v2.19/lib/mongo/error/unknown_payload_type.rb,
build/ruby-driver-v2.19/lib/mongo/error/unsupported_features.rb,
build/ruby-driver-v2.19/lib/mongo/error/internal_driver_error.rb,
build/ruby-driver-v2.19/lib/mongo/error/invalid_config_option.rb,
build/ruby-driver-v2.19/lib/mongo/error/invalid_database_name.rb,
build/ruby-driver-v2.19/lib/mongo/error/invalid_file_revision.rb,
build/ruby-driver-v2.19/lib/mongo/error/invalid_min_pool_size.rb,
build/ruby-driver-v2.19/lib/mongo/error/invalid_write_concern.rb,
build/ruby-driver-v2.19/lib/mongo/error/unsupported_collation.rb,
build/ruby-driver-v2.19/lib/mongo/error/connection_unavailable.rb,
build/ruby-driver-v2.19/lib/mongo/error/credential_check_error.rb,
build/ruby-driver-v2.19/lib/mongo/error/invalid_bulk_operation.rb,
build/ruby-driver-v2.19/lib/mongo/error/sessions_not_supported.rb,
build/ruby-driver-v2.19/lib/mongo/error/change_stream_resumable.rb,
build/ruby-driver-v2.19/lib/mongo/error/invalid_collection_name.rb,
build/ruby-driver-v2.19/lib/mongo/error/invalid_update_document.rb,
build/ruby-driver-v2.19/lib/mongo/error/mongocryptd_spawn_error.rb,
build/ruby-driver-v2.19/lib/mongo/error/unexpected_chunk_Length.rb,
build/ruby-driver-v2.19/lib/mongo/error/bad_load_balancer_target.rb,
build/ruby-driver-v2.19/lib/mongo/error/invalid_application_name.rb,
build/ruby-driver-v2.19/lib/mongo/error/invalid_cursor_operation.rb,
build/ruby-driver-v2.19/lib/mongo/error/invalid_server_auth_host.rb,
build/ruby-driver-v2.19/lib/mongo/error/server_api_not_supported.rb,
build/ruby-driver-v2.19/lib/mongo/error/session_not_materialized.rb,
build/ruby-driver-v2.19/lib/mongo/error/unsupported_message_type.rb,
build/ruby-driver-v2.19/lib/mongo/error/invalid_server_preference.rb,
build/ruby-driver-v2.19/lib/mongo/error/unsupported_array_filters.rb,
build/ruby-driver-v2.19/lib/mongo/error/server_certificate_revoked.rb,
build/ruby-driver-v2.19/lib/mongo/error/invalid_bulk_operation_type.rb,
build/ruby-driver-v2.19/lib/mongo/error/connection_check_out_timeout.rb,
build/ruby-driver-v2.19/lib/mongo/error/insufficient_iteration_count.rb,
build/ruby-driver-v2.19/lib/mongo/error/invalid_replacement_document.rb,
build/ruby-driver-v2.19/lib/mongo/error/invalid_server_auth_response.rb,
build/ruby-driver-v2.19/lib/mongo/error/failed_string_prep_validation.rb,
build/ruby-driver-v2.19/lib/mongo/error/invalid_transaction_operation.rb,
build/ruby-driver-v2.19/lib/mongo/error/missing_scram_server_signature.rb,
build/ruby-driver-v2.19/lib/mongo/error/unchangeable_collection_option.rb,
build/ruby-driver-v2.19/lib/mongo/error/no_service_connection_available.rb,
build/ruby-driver-v2.19/lib/mongo/error/snapshot_session_invalid_server_version.rb,
build/ruby-driver-v2.19/lib/mongo/error/snapshot_session_transaction_prohibited.rb

개요

모든 mongo 관련 오류에 대한 기본 오류 클래스입니다.

이후:

  • 2.0.0

직접 알려진 하위 클래스

BadLoadBalancerTarget, BulkWriteError, ClientClosed, ClosedStream, ConnectionPerished, ConnectionUnavailable, CryptError, ExtraFileChunk, FailedStringPrepValidation, FileNotFound, HandshakeError, InsufficientIterationCount, InternalDriverError, InvalidAddress, InvalidApplicationName, InvalidBulkOperation, InvalidBulkOperationType, InvalidCollectionName, InvalidConfigOption, InvalidCursorOperation, InvalidDatabaseName, InvalidDocument, InvalidFile, InvalidFileRevision, InvalidMinPoolSize, InvalidNonce, InvalidReadConcern, InvalidReadOption, InvalidReplacementDocument, InvalidServerPreference, InvalidSession, InvalidSignature, InvalidTXTRecord, InvalidTransactionOperation, InvalidURI, InvalidUpdateDocument, InvalidWriteConcern, LintError, MaxBSONSize, MaxMessageSize, MismatchedDomain, MissingConnection, MissingFileChunk, MissingPassword, MissingResumeToken, MissingScramServerSignature, MissingServiceId, MultiIndexDrop, NeedPrimaryServer, N oSRVRecords, NoServerAvailable, NoServiceConnectionAvailable, OperationFailure, PoolError, ServerApiConflict, ServerApiNotSupported, ServerCertificateRevoked, ServerNotUsable, SessionEnded, SnapshotSessionInvalidServerVersion, SnapshotSessionTransactionProhibited, SocketError, SocketTimeoutError, UnchangeableCollectionOption, UnexpectedChunkLength, UnexpectedResponse, UnknownPayloadType, UnmetDependency, UnsupportedFeatures, UnsupportedMessageType, UnsupportedOption, Server::AppMetadata:: Environment::MissingVariable, Server::AppMetadata::Environment::TooManyEnvironments, Server::AppMetadata::Environment::TypeMismatch, Server::AppMetadata::Environment::ValueTooLong

네임스페이스 아래에 정의됨

모듈: ChangeStreamResumable, Labelable, Notable, ReadWriteRetryable, SdamErrorDetection, WriteRetryable Classes: AuthError, BadLoadBalancerTarget, BulkWriteError, ClientClosed, ClosedStream, ConnectionCheckOutTimeout, ConnectionPerished, ConnectionUnavailable, CredentialCheckError, CryptError, ExtraFileChunk, FailedStringPrepValidation, FileNotFound, HandshakeError, InsufficientIterationCount, InternalDriverError, InvalidAddress, InvalidApplicationName, InvalidBulkOperation, InvalidBulkOperationType, InvalidCollectionName, InvalidConfigOption, InvalidCursorOperation, InvalidDatabaseName, InvalidDocument, InvalidFile, InvalidFileRevision, InvalidMinPoolSize, InvalidNonce, InvalidReadConcern, InvalidReadOption, InvalidReplacementDocument, InvalidServerAuthHost, InvalidServerAuthResponse, InvalidServerPreference, InvalidSession, InvalidSignature, InvalidTXTRecord, InvalidTransactionOperation, InvalidURI, InvalidUpdateDocument, InvalidWriteConcern, KmsError, LintError, MaxBSONSize, MaxMessageSize, MismatchedDomain, MissingConnection, MissingFileChunk, MissingPassword, MissingResumeToken, MissingScramServerSignature, MissingServiceId, MongocryptdSpawnError, MultiIndexDrop, NeedPrimaryServer, NoSRVRecords, NoServerAvailable, NoServiceConnectionAvailable, OperationFailure, Parser, PoolClearedError, PoolClosedError, PoolError, PoolPausedError, RaiseOriginalError, ServerApiConflict, ServerApiNotSupported, ServerCertificateRevoked, ServerNotUsable, SessionEnded, SessionNotMaterialized, SessionsNotSupported, SnapshotSessionInvalidServerVersion, SnapshotSessionTransactionProhibited, SocketError, SocketTimeoutError, UnchangeableCollectionOption, UnexpectedChunkLength, UnexpectedResponse, UnknownPayloadType, UnmetDependency, UnsupportedArrayFilters, UnsupportedCollation, UnsupportedFeatures, UnsupportedMessageType, UnsupportedOption

상수 요약 접기

코드 =

오류 코드 필드입니다.

이후:

  • 2.0.0

'코드'.동결
ERR =
더 이상 사용되지 않습니다.

오류 필드, MongoDB < 2.6

이후:

  • 2.0.0

'$err'.동결
오류 =
더 이상 사용되지 않습니다.

오류 필드, MongoDB < 2.4

이후:

  • 2.0.0

'err'.동결
ERRMSG =
더 이상 사용되지 않습니다.

표준 오류 메시지 필드, MongoDB 3.0+

이후:

  • 2.0.0

'errmsg'.동결
WRITE_ERRORS =
더 이상 사용되지 않습니다.

writeErrors 배열의 상수입니다.

이후:

  • 2.0.0

'writeErrors'.동결
WRITE_CONCERN_ERROR =
더 이상 사용되지 않습니다.

쓰기 고려 (write concern) 오류에 대한 상수입니다.

이후:

  • 2.0.0

'writeConcernError'.동결
WRITE_CONCERN_ERRORS =
더 이상 사용되지 않습니다.

쓰기 고려 오류에 대한 상수입니다.

이후:

  • 2.1.0

'writeConcernErrors'.동결
UNKNOWN_ERROR =

알 수 없는 오류에 대한 상수입니다.

이후:

  • 2.0.0

8.동결
BAD_밸류 =

잘못된 값 오류에 대한 상수입니다.

이후:

  • 2.0.0

2.동결
CURSOR_NOT_FOUND =

커서를 찾을 수 없음 오류에 대한 상수입니다.

이후:

  • 2.2.3

'커서를 찾을 수 없습니다.'
UNKNOWN_TRANSACTION_COMMIT_RESULT_LABEL =
더 이상 사용되지 않습니다.

사용자가 커밋을 수동으로 재시도할 때 다시 발생할 수도 있고 그렇지 않을 수도 있는 commitTransaction 오류를 설명하는 오류 레이블입니다.

이후:

  • 2.6.0

'UnknownTransactionCommitResult'.동결
TRANSIENT_TRANSACTION_ERROR_LABEL =
더 이상 사용되지 않습니다.

트랜잭션을 처음부터 수동으로 다시 시도할 경우 발생하지 않을 가능성이 높은 오류를 설명하는 오류 레이블입니다.

이후:

  • 2.6.0

'TransientTransactionError'.동결

인스턴스 속성 요약

Notable에 포함된 속성

#connection_global_id, #generation, #service_id

인스턴스 메서드 요약 접기

WriteRetryable에 포함된 메서드

#write_retryable?

Labelable에 포함된 메서드

#add_label, #label?, #labels

Notable에 포함된 메서드

#add_note, #add_notes, #notes, #to_s

생성자 세부 정보

#initialize(msg = nil) ⇒ 오류

Error의 새 인스턴스를 반환합니다.

이후:

  • 2.0.0



112
113
114
115
# 파일 'build/ruby-driver-v2.19/lib/mongo/error.rb', 줄 112

def 초기화(msg = nil)
  super
  @write_concern_error_labels = []
end

인스턴스 메서드 세부 정보

#change_stream_resumable?true, false

이 오류를 트리거한 작업이 getMore인 경우 이 오류가 발생한 변경 스트림을 재개할 수 있나요?

예시:

변경 스트림에 대해 오류를 재개할 수 있나요?

error.change_stream_resumable?

반환합니다:

  • (true, false)

    오류가 재개 가능한지 여부입니다.

이후:

  • 2.6.0



94
95
96
# 파일 'build/ruby-driver-v2.19/lib/mongo/error.rb', 줄 94

def change_stream_resumable?
  거짓
end

#write_concern_error_label?(레이블) ⇒ 부울

쓰기 고려 오류에 지정된 레이블이 있나요?

매개변수:

  • 레이블 (string)

    존재 여부를 확인할 레이블입니다.

반환합니다:

  • (부울)

    쓰기 고려 (write concern) 고려 오류에 지정된 레이블이 있는지 여부입니다.

이후:

  • 2.0.0



122
123
124
# 파일 'build/ruby-driver-v2.19/lib/mongo/error.rb', 줄 122

def write_concern_error_label?(레이블)
  @write_concern_error_labels.포함?(레이블)
end

#write_concern_error_labelsArray<String>

쓰기 고려 (write concern) 오류와 관련된 오류 레이블 설정하다 입니다.

반환합니다:

  • (Array<String>)

    오류 레이블 목록입니다.

이후:

  • 2.0.0



129
130
131
# 파일 'build/ruby-driver-v2.19/lib/mongo/error.rb', 줄 129

def write_concern_error_labels
  @write_concern_error_labels.dup
end