Serializable
MongoNodeIsRecoveringException
, MongoNotPrimaryException
public class MongoCommandException extends MongoServerException
TRANSIENT_TRANSACTION_ERROR_LABEL, UNKNOWN_TRANSACTION_COMMIT_RESULT_LABEL
Constructor | Description |
---|---|
MongoCommandException(BsonDocument response,
ServerAddress address) |
Construct a new instance with the CommandResult from a failed command
|
Modifier and Type | Method | Description |
---|---|---|
int |
getErrorCode() |
Gets the error code associated with the command failure.
|
String |
getErrorCodeName() |
Gets the name associated with the error code.
|
String |
getErrorMessage() |
Gets the error message associated with the command failure.
|
BsonDocument |
getResponse() |
For internal use only.
|
addLabel, fromThrowable, fromThrowableNonNull, getCode, getErrorLabels, hasErrorLabel, removeLabel
getServerAddress
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
public MongoCommandException(BsonDocument response, ServerAddress address)
response
- the command responseaddress
- the address of the server that generated the responsepublic int getErrorCode()
public String getErrorCodeName()
public String getErrorMessage()
public BsonDocument getResponse()