Class: Mongo::Error::InvalidUpdateDocument
- Inherits:
-
Error
- Object
- Error
- Mongo::Error::InvalidUpdateDocument
- Defined in:
- lib/mongo/error/invalid_update_document.rb
Overview
Exception raised if the object is not a valid update document.
Constant Summary collapse
- MESSAGE =
Deprecated.
The error message.
'Invalid update document provided'
Class Method Summary collapse
-
.message(key) ⇒ String
private
Construct the error message.
-
.warn(logger, key) ⇒ Object
private
Send and cache the warning.
Instance Method Summary collapse
-
#initialize(key: nil) ⇒ InvalidUpdateDocument
constructor
Instantiate the new exception.
Constructor Details
#initialize(key: nil) ⇒ InvalidUpdateDocument
Instantiate the new exception.
54 55 56 |
# File 'lib/mongo/error/invalid_update_document.rb', line 54 def initialize(key: nil) super(self.class.(key)) end |
Class Method Details
.message(key) ⇒ String
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Construct the error message.
35 36 37 38 39 |
# File 'lib/mongo/error/invalid_update_document.rb', line 35 def self.(key) = 'Invalid update document provided. Update documents must only ' += "contain only atomic modifiers. The \"#{key}\" key is invalid." end |
.warn(logger, key) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Send and cache the warning.
44 45 46 47 48 49 |
# File 'lib/mongo/error/invalid_update_document.rb', line 44 def self.warn(logger, key) @warned ||= begin logger.warn((key)) true end end |