Class MongoException
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
infoSerializationInfoThe SerializationInfo.
contextStreamingContextThe StreamingContext.
MongoException(string)
Initializes a new instance of the MongoException class.
public MongoException(string message)
Parameters
messagestringThe error message.
MongoException(string, Exception)
Initializes a new instance of the MongoException class.
public MongoException(string message, Exception innerException)
Parameters
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
errorLabelstringThe error label.
GetObjectData(SerializationInfo, StreamingContext)
public override void GetObjectData(SerializationInfo info, StreamingContext context)
Parameters
infoSerializationInfocontextStreamingContext
HasErrorLabel(string)
Determines whether the exception has some error label.
public bool HasErrorLabel(string errorLabel)
Parameters
errorLabelstringThe error label.
Returns
- bool
trueif the exception has some error label; otherwise,false.
RemoveErrorLabel(string)
Removes the error label.
public void RemoveErrorLabel(string errorLabel)
Parameters
errorLabelstringThe error label.