Package com.mongodb
Class WriteConcernException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- java.lang.RuntimeException
-
- com.mongodb.MongoException
-
- com.mongodb.MongoServerException
-
- com.mongodb.WriteConcernException
-
- All Implemented Interfaces:
java.io.Serializable
- Direct Known Subclasses:
DuplicateKeyException
@Deprecated(since="2021-05-27") public class WriteConcernException extends MongoServerException
Deprecated.Usage of this API is not supported in AEM as a Cloud Service.An exception representing an error reported due to a write failure.- 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 WriteConcernException(BsonDocument response, ServerAddress address, WriteConcernResult writeConcernResult)Deprecated.Construct a new instance.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static intextractErrorCode(BsonDocument response)Deprecated.For internal use only: extract the error code from the response to a write command.static java.lang.StringextractErrorMessage(BsonDocument response)Deprecated.For internal use only: extract the error message from the response to a write command.intgetErrorCode()Deprecated.Gets the error code associated with the write concern failure.java.lang.StringgetErrorMessage()Deprecated.Gets the error message associated with the write concern failure.BsonDocumentgetResponse()Deprecated.Gets the response to the write operation.WriteConcernResultgetWriteConcernResult()Deprecated.Gets the write result.-
Methods inherited from class com.mongodb.MongoServerException
getServerAddress
-
Methods inherited from class com.mongodb.MongoException
addLabel, fromThrowable, fromThrowableNonNull, getCode, getErrorLabels, hasErrorLabel, removeLabel
-
-
-
-
Constructor Detail
-
WriteConcernException
public WriteConcernException(BsonDocument response, ServerAddress address, WriteConcernResult writeConcernResult)
Deprecated.Construct a new instance.- Parameters:
response- the response to the write operationaddress- the address of the server that executed the operationwriteConcernResult- the write concern result
-
-
Method Detail
-
extractErrorCode
public static int extractErrorCode(BsonDocument response)
Deprecated.For internal use only: extract the error code from the response to a write command.- Parameters:
response- the response- Returns:
- the code, or -1 if there is none
-
extractErrorMessage
@Nullable public static java.lang.String extractErrorMessage(BsonDocument response)
Deprecated.For internal use only: extract the error message from the response to a write command.- Parameters:
response- the response- Returns:
- the error message
-
getWriteConcernResult
public WriteConcernResult getWriteConcernResult()
Deprecated.Gets the write result.- Returns:
- the write result
-
getErrorCode
public int getErrorCode()
Deprecated.Gets the error code associated with the write concern failure.- Returns:
- the error code
-
getErrorMessage
@Nullable public java.lang.String getErrorMessage()
Deprecated.Gets the error message associated with the write concern failure.- Returns:
- the error message
-
getResponse
public BsonDocument getResponse()
Deprecated.Gets the response to the write operation.- Returns:
- the response to the write operation
-
-