Table of Contents

Class MongoException

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

Represents a MongoDB exception.

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

Constructors

MongoException(SerializationInfo, StreamingContext)

Initializes a new instance of the MongoException class.

public MongoException(SerializationInfo info, StreamingContext context)

Parameters

info SerializationInfo

The SerializationInfo.

context StreamingContext

The StreamingContext.

MongoException(string)

Initializes a new instance of the MongoException class.

public MongoException(string message)

Parameters

message string

The error message.

MongoException(string, Exception)

Initializes a new instance of the MongoException class.

public MongoException(string message, Exception innerException)

Parameters

message string

The error message.

innerException Exception

The inner exception.

Properties

ErrorLabels

Gets the error labels.

public IReadOnlyList<string> ErrorLabels { get; }

Property Value

IReadOnlyList<string>

The error labels.

Methods

AddErrorLabel(string)

Adds an error label.

public void AddErrorLabel(string errorLabel)

Parameters

errorLabel string

The error label.

GetObjectData(SerializationInfo, StreamingContext)

public override void GetObjectData(SerializationInfo info, StreamingContext context)

Parameters

info SerializationInfo
context StreamingContext

HasErrorLabel(string)

Determines whether the exception has some error label.

public bool HasErrorLabel(string errorLabel)

Parameters

errorLabel string

The error label.

Returns

bool

true if the exception has some error label; otherwise, false.

RemoveErrorLabel(string)

Removes the error label.

public void RemoveErrorLabel(string errorLabel)

Parameters

errorLabel string

The error label.