public class WriteConcernException extends MongoServerException
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
fromThrowable, getCode
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 responsepublic static java.lang.String extractErrorMessage(BsonDocument response)
response
- the responsepublic WriteConcernResult getWriteConcernResult()
public int getErrorCode()
public java.lang.String getErrorMessage()
public BsonDocument getResponse()