Class: Mongo::Error::BulkWriteError
- Inherits:
-
Error
- Object
- Error
- Mongo::Error::BulkWriteError
- Defined in:
- lib/mongo/error/bulk_write_error.rb
Overview
Note:
A bulk operation that resulted in a BulkWriteError may have written some of the documents to the database. If the bulk write was unordered, writes may have also continued past the write that produced a BulkWriteError.
Exception raised if there are write errors upon executing a bulk operation.
Unlike OperationFailure, BulkWriteError does not currently expose
individual error components (such as the error code). The result document
(which can be obtained using the result attribute) provides detailed
error information and can be examined by the application if desired.
Instance Attribute Summary collapse
-
#result ⇒ BSON::Document
readonly
Result The error result.
Instance Method Summary collapse
-
#initialize(result) ⇒ BulkWriteError
constructor
Instantiate the new exception.
Constructor Details
#initialize(result) ⇒ BulkWriteError
Instantiate the new exception.
46 47 48 49 50 51 52 53 |
# File 'lib/mongo/error/bulk_write_error.rb', line 46 def initialize(result) @result = result # Exception constructor behaves differently for a nil argument and # for no argument. Avoid passing nil explicitly. = ? super() : super() end |
Instance Attribute Details
#result ⇒ BSON::Document (readonly)
Returns result The error result.
35 36 37 |
# File 'lib/mongo/error/bulk_write_error.rb', line 35 def result @result end |