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.
28 29 30 31 32 |
# File 'lib/mongo/exceptions.rb', line 28 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.
26 27 28 |
# File 'lib/mongo/exceptions.rb', line 26 def error_code @error_code end |
#result ⇒ Object (readonly)
Returns The entire failed command’s response object, if available.
23 24 25 |
# File 'lib/mongo/exceptions.rb', line 23 def result @result end |