Class MongoCommandException
Represents a MongoDB command exception.
[Serializable]
public class MongoCommandException : MongoServerException, ISerializable
- Inheritance
-
MongoCommandException
- Implements
- Derived
- Inherited Members
Constructors
MongoCommandException(ConnectionId, string, BsonDocument)
Initializes a new instance of the MongoCommandException class.
public MongoCommandException(ConnectionId connectionId, string message, BsonDocument command)
Parameters
connectionId
ConnectionIdThe connection identifier.
message
stringThe message.
command
BsonDocumentThe command.
MongoCommandException(ConnectionId, string, BsonDocument, BsonDocument)
Initializes a new instance of the MongoCommandException class.
public MongoCommandException(ConnectionId connectionId, string message, BsonDocument command, BsonDocument result)
Parameters
connectionId
ConnectionIdThe connection identifier.
message
stringThe message.
command
BsonDocumentThe command.
result
BsonDocumentThe command result.
MongoCommandException(ConnectionId, string, BsonDocument, BsonDocument, Exception)
Initializes a new instance of the MongoCommandException class.
public MongoCommandException(ConnectionId connectionId, string message, BsonDocument command, BsonDocument result, Exception innerException)
Parameters
connectionId
ConnectionIdThe connection identifier.
message
stringThe message.
command
BsonDocumentThe command.
result
BsonDocumentThe command result.
innerException
ExceptionThe inner exception.
MongoCommandException(SerializationInfo, StreamingContext)
Initializes a new instance of the MongoCommandException class.
protected MongoCommandException(SerializationInfo info, StreamingContext context)
Parameters
info
SerializationInfoThe SerializationInfo.
context
StreamingContextThe StreamingContext.
Properties
Code
Gets the error code.
public int Code { get; }
Property Value
- int
The error code.
CodeName
Gets the name of the error code.
public string CodeName { get; }
Property Value
- string
The name of the error code.
Command
Gets the command.
public BsonDocument Command { get; }
Property Value
- BsonDocument
The command.
ErrorMessage
Gets the error message.
public string ErrorMessage { get; }
Property Value
- string
The error message.
Result
Gets the command result.
public BsonDocument Result { get; }
Property Value
- BsonDocument
The command result.
Methods
GetObjectData(SerializationInfo, StreamingContext)
public override void GetObjectData(SerializationInfo info, StreamingContext context)
Parameters
info
SerializationInfocontext
StreamingContext