Package com.mongodb.bulk
Class WriteConcernError
java.lang.Object
com.mongodb.bulk.WriteConcernError
An error representing a failure by the server to apply the requested write concern to the bulk operation.
- Since:
- 3.0
- MongoDB documentation
- Write Concern
-
Constructor Summary
ConstructorDescriptionWriteConcernError
(int code, String codeName, String message, BsonDocument details) Constructs a new instance.WriteConcernError
(int code, String codeName, String message, BsonDocument details, Set<String> errorLabels) Deprecated.Prefer using error labels included in the top level response document -
Method Summary
Modifier and TypeMethodDescriptionvoid
Deprecated.Prefer using error labels included in the top level response documentboolean
int
getCode()
Gets the code associated with this error.Gets the name associated with the error code.Gets the details associated with this error.Deprecated.Prefer using error labels included in the top level response documentGets the message associated with this error.int
hashCode()
toString()
-
Constructor Details
-
WriteConcernError
Constructs a new instance.- Parameters:
code
- the error codecodeName
- the error code namemessage
- the error messagedetails
- any details
-
WriteConcernError
@Deprecated public WriteConcernError(int code, String codeName, String message, BsonDocument details, Set<String> errorLabels) Deprecated.Prefer using error labels included in the top level response documentConstructs a new instance.- Parameters:
code
- the error codecodeName
- the error code namemessage
- the error messagedetails
- any detailserrorLabels
- any error labels- Since:
- 4.1
-
-
Method Details
-
getCode
public int getCode()Gets the code associated with this error.- Returns:
- the code
-
getCodeName
Gets the name associated with the error code.- Returns:
- the error code name, which may be the empty string
- Since:
- 3.8
- Since server release
- 3.4
-
getMessage
Gets the message associated with this error.- Returns:
- the message
-
getDetails
Gets the details associated with this error. This document will not be null, but may be empty.- Returns:
- the details
-
addLabel
Deprecated.Prefer using error labels included in the top level response documentAdds the given error label to the exception.- Parameters:
errorLabel
- the non-null error label to add to the exception- Since:
- 4.1
-
getErrorLabels
Deprecated.Prefer using error labels included in the top level response documentGets the set of error labels associated with this exception.- Returns:
- the error labels, which may not be null but may be empty
- Since:
- 4.1
-
equals
-
hashCode
public int hashCode() -
toString
-