Exception: Mongo::MongoDBError
- Defined in:
- lib/mongo/exceptions.rb
Overview
Raised when MongoDB itself has returned an error.
Direct Known Subclasses
AuthenticationError, ConnectionFailure, InvalidOperation, OperationFailure
Instance Attribute Summary collapse
-
#error_code ⇒ Object
readonly
The failed command’s error code, if availab.e.
-
#result ⇒ Object
readonly
The entire failed command’s response object, if available.
Instance Method Summary collapse
-
#initialize(message = nil, error_code = nil, result = nil) ⇒ MongoDBError
constructor
A new instance of MongoDBError.
Constructor Details
#initialize(message = nil, error_code = nil, result = nil) ⇒ MongoDBError
Returns a new instance of MongoDBError.
14 15 16 17 18 |
# File 'lib/mongo/exceptions.rb', line 14 def initialize(=nil, error_code=nil, result=nil) @error_code = error_code @result = result super() end |
Instance Attribute Details
#error_code ⇒ Object (readonly)
Returns The failed command’s error code, if availab.e.
12 13 14 |
# File 'lib/mongo/exceptions.rb', line 12 def error_code @error_code end |
#result ⇒ Object (readonly)
Returns The entire failed command’s response object, if available.
9 10 11 |
# File 'lib/mongo/exceptions.rb', line 9 def result @result end |