모듈: OperationFailure::Family
- 확장자:
- 전달 가능
- 다음에 정의됨:
- lib/ Mongo/error/operation_failure.rb
개요
OperationFailure 오류에 대한 동작을 구현합니다. 기타 오류(예: ServerTimeoutError)도 이를 구현 OperationFailure 오류로 인식되고 처리될 수 있습니다.
상수 요약 접기
- CHANGE_STREAM_RESUME_ERRORS =
이 상수는 비공개 API의 일부입니다. 이 상수는 향후 제거되거나 변경될 수 있으므로 가능하면 사용하지 않는 것이 좋습니다.
변경 스트림이 재개되지 않을 때 실패하는 getMore 명령을 유발하는 오류 코드 및 코드 이름입니다.
[ { code_name: 'HostUnreachable', 코드: 6 }, { code_name: 'HostNotFound', 코드: 7 }, { code_name: 'NetworkTimeout', 코드: 89 }, { code_name: 'ShutdownInProgress', 코드: 91 }, { code_name: 'PrimarySteppedDown', 코드: 189 }, { code_name: 'ExceededTimeLimit', 코드: 262 }, { code_name: 'SocketException', 코드: 9001 }, { code_name: 'NotMaster', 코드: 10_107 }, { code_name: 'InterruptedAtShutdown', 코드: 11_600 }, { code_name: 'InterruptedDueToReplStateChange', 코드: 11_602 }, { code_name: 'NotPrimaryNoSecondaryOk', 코드: 13_435 }, { code_name: 'NotMasterOrSecondary', 코드: 13_436 }, { code_name: 'StaleShardVersion', 코드: 63 }, { code_name: 'FailedToSatisfyReadPreference', 코드: 133 }, { code_name: 'StaleEpoch', 코드: 150 }, { code_name: 'RetryChangeStream', 코드: 234 }, { code_name: 'StaleConfig', 코드: 13_388 }, ].동결
- CHANGE_STREAM_RESUME_MESSAGES =
이 상수는 비공개 API의 일부입니다. 이 상수는 향후 제거되거나 변경될 수 있으므로 가능하면 사용하지 않는 것이 좋습니다.
이러한 오류 메시지가 발생하면 변경 스트림 을 재개할 수 있습니다.
ReadWriteRetryable::WRITE_RETRY_MESSAGES
Mongo::Error::ReadWriteRetryable에 포함된 상수
Mongo::Error::ReadWriteRetryable::RETRY_MESSAGES, Mongo::Error::ReadWriteRetryable::WRITE_RETRY_ERRORS, Mongo::Error::ReadWriteRetryable::WRITE_RETRY_MESSAGES
Mongo::Error::SdamErrorDetection에 포함된 상수
Mongo::Error::SdamErrorDetection::NODE_RECOVERING_CODES, Mongo::Error::SdamErrorDetection::NODE_SHUTTING_DOWN_CODES, Mongo::Error::SdamErrorDetection::NOT_MASTER_CODES
인스턴스 속성 요약 접기
-
#코드 ⇒ 정수
읽기 전용
문서에서 구문 분석된 오류 코드입니다.
-
#code_name ⇒ string
읽기 전용
문서에서 구문 분석된 오류 코드 이름입니다.
-
#세부 정보 ⇒ string | nil
읽기 전용
오류의 세부 정보입니다.
-
#document ⇒ BSON::Document | nil
읽기 전용
서버에서 반환한 오류 문서.
-
#결과 ⇒ Operation::Result
읽기 전용
비공개
작업의 결과 객체 .
-
#server_message ⇒ string
읽기 전용
응답에서 구문 분석된 서버 반환 오류 메시지입니다.
-
#write_concern_error_code ⇒ 정수 | nil
읽기 전용
쓰기 고려 오류가 존재하고 코드가 있는 경우 쓰기 고려 오류에 대한 오류 코드입니다.
-
#write_concern_error_code_name ⇒ string | nil
읽기 전용
쓰기 고려 (write concern) 쓰기 고려 (write concern) 의 코드 이름입니다.
-
#write_concern_error_document ⇒ 해시 | nil
읽기 전용
서버에서 보고한 쓰기 고려 오류 문서(있는 경우)를 반환합니다.
인스턴스 메서드 요약 접기
-
#change_stream_resumable? ⇒ 참, 거짓
이 오류를 트리거한 작업이 getMore인 경우 이 오류가 발생한 변경 스트림 을 재개할 수 있나요?
-
#connection_description ⇒ Server::Description
비공개
이 예외가 참조하는 작업이 수행된 서버 에 대한 서버 설명입니다.
-
#initialize(message = nil, 결과 = nil, options = {}) ⇒ 객체
작업 실패를 만듭니다.
-
#max_time_ms_expired? ⇒ true | false
오류가 MaxTimeMSExpired인지 여부입니다.
-
#write_concern_error? ⇒ true | false
실패에 쓰기 고려 오류가 포함되는지 여부입니다.
-
#wtimeout? ⇒ true | false
오류가 쓰기 고려 (write concern) 시간 초과인지 여부입니다.
Mongo::Error::ReadWriteRetryable에 포함된 메서드
#retryable?, #write_retryable?
Mongo::Error::SdamErrorDetection에 포함된 메서드
#node_recovering?, #node_shutting_down?, #not_master?
인스턴스 속성 세부 정보
#코드 ⇒ 정수 (읽기 전용)
반환값 문서 에서 구문 분석된 오류 코드를 반환합니다.
43 44 45 |
# 파일 'lib/ Mongo/error/operation_failure.rb', 줄 43 def 코드 @code end |
#code_name ⇒ string (읽기 전용)
반환값 문서에서 구문 분석된 오류 코드 이름을 반환합니다.
48 49 50 |
# 파일 'lib/ Mongo/error/operation_failure.rb', 줄 48 def code_name @code_name end |
#세부 정보 ⇒ string | nil (읽기 전용)
오류의 세부 정보를 반환합니다. WriteConcernErrors의 경우 document['writeConcernError']['errInfo']입니다. WriteErrors의 경우 document['writeErrors'][0]['errInfo']입니다. 다른 모든 오류의 경우 이 값은 nil입니다.
151 152 153 |
# 파일 'lib/ Mongo/error/operation_failure.rb', 줄 151 def 세부 정보 @details end |
#문서 ⇒ BSON::Document | nil (읽기 전용)
서버에서 반환한 오류 문서를 반환합니다.
156 157 158 |
# 파일 'lib/ Mongo/error/operation_failure.rb', 줄 156 def 문서 @document end |
#결과 ⇒ Operation::Result (읽기 전용)
이 메서드는 비공개 API의 일부입니다. 이 방법은 향후 제거되거나 변경될 수 있으므로 가능하면 사용하지 않는 것이 좋습니다.
작업의 결과 객체 반환합니다.
161 162 163 |
# 파일 'lib/ Mongo/error/operation_failure.rb', 줄 161 def 결과 @result end |
#server_message ⇒ string (읽기 전용)
응답에서 구문 분석된 서버 반환 오류 메시지를 반환합니다.
54 55 56 |
# 파일 'lib/ Mongo/error/operation_failure.rb', 줄 54 def @server_message end |
#write_concern_error_code ⇒ 정수 | nil (읽기 전용)
쓰기 고려 오류가 있고 코드가 있는 경우 쓰기 고려 오류에 대한 오류 코드를 반환합니다.
139 140 141 |
# 파일 'lib/ Mongo/error/operation_failure.rb', 줄 139 def write_concern_error_code @write_concern_error_code end |
#write_concern_error_code_name ⇒ string | nil (읽기 전용)
쓰기 고려 오류가 있고 코드명이 있는 경우 쓰기 고려 오류에 대한 코드 이름을 반환합니다.
145 146 147 |
# 파일 'lib/ Mongo/error/operation_failure.rb', 줄 145 def write_concern_error_code_name @write_concern_error_code_name end |
#write_concern_error_document ⇒ 해시 | nil (읽기 전용)
서버에서 보고한 쓰기 고려 오류 문서(있는 경우)를 반환합니다.
133 134 135 |
# 파일 'lib/ Mongo/error/operation_failure.rb', 줄 133 def write_concern_error_document @write_concern_error_document end |
인스턴스 메서드 세부 정보
#change_stream_resumable? ⇒ true, false
이 오류를 트리거한 작업이 getMore인 경우 이 오류가 발생한 변경 스트림을 재개할 수 있나요?
96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 |
# 파일 'lib/ Mongo/error/operation_failure.rb', 줄 96 def change_stream_resumable? 만약 @result && @result.is_a?(mongo::작업::자세히 보기::결과) # 서버 예외는 항상 재개될 수 있습니다. # 커서 ID를 인식하지 못하므로 다음 여부를 확인할 수 없습니다. # 커서는 변경 스트림이므로 추가할 수 없습니다. # ResumableChangeStreamError 레이블. 반환 true 만약 코드 == 43 # 승인되지 않은 쓰기에 대해서는 연결 설명이 채워지지 않습니다. 만약 connection_description.max_wire_version >= 9 레이블?('ResumableChangeStreamError') other change_stream_resumable_code? end other 거짓 end end |
#connection_description ⇒ Server::Description
이 메서드는 비공개 API의 일부입니다. 이 방법은 향후 제거되거나 변경될 수 있으므로 가능하면 사용하지 않는 것이 좋습니다.
이 예외가 참조하는 작업이 수행된 서버에 대한 MongoDB Server 설명을 반환합니다.
38 |
# 파일 'lib/ Mongo/error/operation_failure.rb', 줄 38 def_delegator :@result, :connection_description |
#initialize(message = nil, 결과 = nil, options = {}) ⇒ 객체
작업 실패를 만듭니다.
186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 |
# 파일 'lib/ Mongo/error/operation_failure.rb', 줄 186 def 초기화( = nil, 결과 = nil, = {}) @details = retrieve_details([:document]) super(append_details(, @details)) @result = 결과 @code = [:code] @code_name = [:code_name] @write_concern_error_document = [:write_concern_error_document] @write_concern_error_code = [:write_concern_error_code] @write_concern_error_code_name = [:write_concern_error_code_name] @write_concern_error_labels = [:write_concern_error_labels] || [] @labels = [:labels] || [] @wtimeout = !![:wtimeout] @document = [:document] @server_message = [:server_message] end |
#max_time_ms_expired? ⇒ true | false
오류가 MaxTimeMSExpired인지 여부입니다.
217 218 219 |
# 파일 'lib/ Mongo/error/operation_failure.rb', 줄 217 def max_time_ms_expired? 코드 == 50 # MaxTimeMSExpired end |
#write_concern_error? ⇒ true | false
반환값 실패에 쓰기 고려 (write concern) 오류가 포함되는지 여부를 반환합니다. 실패에는 최상위 오류와 쓰기 고려 (write concern) 오류 또는 둘 중 하나가 있을 수 있습니다.
125 126 127 |
# 파일 'lib/ Mongo/error/operation_failure.rb', 줄 125 def write_concern_error? !!@write_concern_error_document end |
#wtimeout? ⇒ true | false
오류가 쓰기 고려 (write concern) 시간 초과인지 여부입니다.
208 209 210 |
# 파일 'lib/ Mongo/error/operation_failure.rb', 줄 208 def wtimeout? @wtimeout end |