public class WriteConcernException extends MongoServerException
TRANSIENT_TRANSACTION_ERROR_LABEL, UNKNOWN_TRANSACTION_COMMIT_RESULT_LABEL
Constructor and Description |
---|
WriteConcernException(BsonDocument response,
ServerAddress address,
WriteConcernResult writeConcernResult)
Construct a new instance.
|
Modifier and Type | Method and Description |
---|---|
static int |
extractErrorCode(BsonDocument response)
For internal use only: extract the error code from the response to a write command.
|
static java.lang.String |
extractErrorMessage(BsonDocument response)
For internal use only: extract the error message from the response to a write command.
|
int |
getErrorCode()
Gets the error code associated with the write concern failure.
|
java.lang.String |
getErrorMessage()
Gets the error message associated with the write concern failure.
|
BsonDocument |
getResponse()
Gets the response to the write operation.
|
WriteConcernResult |
getWriteConcernResult()
Gets the write result.
|
getServerAddress
addLabel, fromThrowable, fromThrowableNonNull, getCode, getErrorLabels, hasErrorLabel, removeLabel
public WriteConcernException(BsonDocument response, ServerAddress address, WriteConcernResult writeConcernResult)
response
- the response to the write operationaddress
- the address of the server that executed the operationwriteConcernResult
- the write concern resultpublic static int extractErrorCode(BsonDocument response)
response
- the response@Nullable public static java.lang.String extractErrorMessage(BsonDocument response)
response
- the responsepublic WriteConcernResult getWriteConcernResult()
public int getErrorCode()
@Nullable public java.lang.String getErrorMessage()
public BsonDocument getResponse()
Copyright © 2010 - 2020 Adobe. All Rights Reserved