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
info
SerializationInfoThe SerializationInfo.
context
StreamingContextThe StreamingContext.
MongoException(string)
Initializes a new instance of the MongoException class.
public MongoException(string message)
Parameters
message
stringThe 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
errorLabel
stringThe error label.
GetObjectData(SerializationInfo, StreamingContext)
public override void GetObjectData(SerializationInfo info, StreamingContext context)
Parameters
info
SerializationInfocontext
StreamingContext
HasErrorLabel(string)
Determines whether the exception has some error label.
public bool HasErrorLabel(string errorLabel)
Parameters
errorLabel
stringThe 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
stringThe error label.