Table of Contents

Class MongoServerException

Namespace
MongoDB.Driver
Assembly
MongoDB.Driver.Core.dll

Represents a MongoDB server exception.

[Serializable]
public class MongoServerException : MongoException, ISerializable
Inheritance
MongoServerException
Implements
Derived
Inherited Members

Constructors

MongoServerException(ConnectionId, string)

Initializes a new instance of the MongoServerException class.

public MongoServerException(ConnectionId connectionId, string message)

Parameters

connectionId ConnectionId

The connection identifier.

message string

The error message.

MongoServerException(ConnectionId, string, Exception)

Initializes a new instance of the MongoServerException class.

public MongoServerException(ConnectionId connectionId, string message, Exception innerException)

Parameters

connectionId ConnectionId

The connection identifier.

message string

The error message.

innerException Exception

The inner exception.

MongoServerException(SerializationInfo, StreamingContext)

Initializes a new instance of the MongoServerException class.

public MongoServerException(SerializationInfo info, StreamingContext context)

Parameters

info SerializationInfo

The SerializationInfo.

context StreamingContext

The StreamingContext.

Properties

ConnectionId

Gets the connection identifier.

public ConnectionId ConnectionId { get; }

Property Value

ConnectionId

Methods

AddErrorLabelsFromCommandResult(MongoServerException, BsonDocument)

Adds error labels from a command result document into the top-level label list.

protected static void AddErrorLabelsFromCommandResult(MongoServerException exception, BsonDocument result)

Parameters

exception MongoServerException

The exception.

result BsonDocument

The result document.

GetObjectData(SerializationInfo, StreamingContext)

public override void GetObjectData(SerializationInfo info, StreamingContext context)

Parameters

info SerializationInfo
context StreamingContext