Package com.mongodb
Class MongoCommandException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- java.lang.RuntimeException
-
- com.mongodb.MongoException
-
- com.mongodb.MongoServerException
-
- com.mongodb.MongoCommandException
-
- All Implemented Interfaces:
java.io.Serializable
- Direct Known Subclasses:
MongoNodeIsRecoveringException,MongoNotPrimaryException
@Deprecated(since="2021-05-27") public class MongoCommandException extends MongoServerException
Deprecated.Usage of this API is not supported in AEM as a Cloud Service.An exception indicating that a command sent to a MongoDB server returned a failure.- Since:
- 2.13
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class com.mongodb.MongoException
TRANSIENT_TRANSACTION_ERROR_LABEL, UNKNOWN_TRANSACTION_COMMIT_RESULT_LABEL
-
-
Constructor Summary
Constructors Constructor Description MongoCommandException(BsonDocument response, ServerAddress address)Deprecated.Construct a new instance with the CommandResult from a failed command
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description intgetErrorCode()Deprecated.Gets the error code associated with the command failure.java.lang.StringgetErrorCodeName()Deprecated.Gets the name associated with the error code.java.lang.StringgetErrorMessage()Deprecated.Gets the error message associated with the command failure.BsonDocumentgetResponse()Deprecated.For internal use only.-
Methods inherited from class com.mongodb.MongoServerException
getServerAddress
-
Methods inherited from class com.mongodb.MongoException
addLabel, fromThrowable, fromThrowableNonNull, getCode, getErrorLabels, hasErrorLabel, removeLabel
-
-
-
-
Constructor Detail
-
MongoCommandException
public MongoCommandException(BsonDocument response, ServerAddress address)
Deprecated.Construct a new instance with the CommandResult from a failed command- Parameters:
response- the command responseaddress- the address of the server that generated the response
-
-
Method Detail
-
getErrorCode
public int getErrorCode()
Deprecated.Gets the error code associated with the command failure.- Returns:
- the error code
-
getErrorCodeName
public java.lang.String getErrorCodeName()
Deprecated.Gets the name associated with the error code.- Returns:
- the error code name, which may be the empty string
- Since:
- 3.8
-
getErrorMessage
public java.lang.String getErrorMessage()
Deprecated.Gets the error message associated with the command failure.- Returns:
- the error message
-
getResponse
public BsonDocument getResponse()
Deprecated.For internal use only.- Returns:
- the full response to the command failure.
-
-