public class MongoCommandException extends MongoServerException
| Constructor and Description | 
|---|
| MongoCommandException(BsonDocument response,
                     ServerAddress address)Construct a new instance with the CommandResult from a failed command | 
| Modifier and Type | Method and Description | 
|---|---|
| int | getErrorCode()Gets the error code associated with the command failure. | 
| String | getErrorMessage()Gets the error message associated with the command failure. | 
| BsonDocument | getResponse()For internal use only. | 
getServerAddressfromThrowable, getCodeaddSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toStringpublic MongoCommandException(BsonDocument response, ServerAddress address)
response - the command responseaddress - the address of the server that generated the responsepublic int getErrorCode()
public String getErrorMessage()
public BsonDocument getResponse()