ServerError
public enum ServerError : MongoError
The possible errors corresponding to types of errors encountered in the MongoDB server. These errors may contain labels providing additional information on their origin.
-
Thrown when commands experience errors on the server that prevent execution.
Declaration
Swift
case commandError(code: ServerErrorCode, message: String, errorLabels: [String]?)
-
Thrown when a single write command fails on the server. Note: Only one of
writeConcernError
orwriteError
will be populated at a time.Declaration
Swift
case writeError(writeError: WriteError?, writeConcernError: WriteConcernError?, errorLabels: [String]?)
-
Thrown when the server returns errors as part of an executed bulk write. Note:
writeErrors
may not be present if the error experienced was a Write Concern related error.Declaration
Swift
case bulkWriteError(writeErrors: [BulkWriteError]?, writeConcernError: WriteConcernError?, result: BulkWriteResult?, errorLabels: [String]?)
-
Declaration
Swift
public var errorDescription: String? { get }