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 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.
|
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
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
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 String extractErrorMessage(BsonDocument response)
response
- the responsepublic WriteConcernResult getWriteConcernResult()
public int getErrorCode()
public String getErrorMessage()
public BsonDocument getResponse()