Exception: Mongo::Error::OperationFailure
- Inherits:
-
Mongo::Error
- Object
- StandardError
- Mongo::Error
- Mongo::Error::OperationFailure
- Defined in:
- lib/mongo/error/operation_failure.rb
Overview
Raised when an operation fails for some reason.
Constant Summary collapse
- RETRY_MESSAGES =
These are magic error messages that could indicate a cluster reconfiguration behind a mongos. We cannot check error codes as they change between versions, for example 15988 which has 2 completely different meanings between 2.4 and 3.0.
[ 'transport error', 'socket exception', "can't connect", 'no master', 'not master', 'could not contact primary', 'connect failed', 'error querying', 'could not get last error', 'connection attempt failed', 'interrupted at shutdown' ].freeze
Constants inherited from Mongo::Error
BAD_VALUE, CODE, ERR, ERRMSG, ERROR, UNKNOWN_ERROR, WRITE_CONCERN_ERROR, WRITE_CONCERN_ERRORS, WRITE_ERRORS
Instance Method Summary collapse
-
#retryable? ⇒ true, false
Can the operation that caused the error be retried?.
Instance Method Details
#retryable? ⇒ true, false
Can the operation that caused the error be retried?
51 52 53 |
# File 'lib/mongo/error/operation_failure.rb', line 51 def retryable? RETRY_MESSAGES.any?{ |m| .include?(m) } end |