Package com.mongodb
Class MongoWriteConcernException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
com.mongodb.MongoException
com.mongodb.MongoServerException
com.mongodb.MongoWriteConcernException
- All Implemented Interfaces:
Serializable
An exception indicating a failure to apply the write concern to the requested write operation
- Since:
- 3.0
- See Also:
-
Field Summary
Fields inherited from class com.mongodb.MongoException
TRANSIENT_TRANSACTION_ERROR_LABEL, UNKNOWN_TRANSACTION_COMMIT_RESULT_LABEL
-
Constructor Summary
ConstructorDescriptionMongoWriteConcernException
(WriteConcernError writeConcernError, ServerAddress serverAddress) Deprecated.MongoWriteConcernException
(WriteConcernError writeConcernError, WriteConcernResult writeConcernResult, ServerAddress serverAddress) MongoWriteConcernException
(WriteConcernError writeConcernError, WriteConcernResult writeConcernResult, ServerAddress serverAddress, Collection<String> errorLabels) Construct an instance. -
Method Summary
Modifier and TypeMethodDescriptionGets the write concern error.Gets the write result.Methods inherited from class com.mongodb.MongoServerException
getErrorCodeName, getServerAddress
Methods inherited from class com.mongodb.MongoException
addLabel, addLabels, addLabels, fromThrowable, fromThrowableNonNull, getCode, getErrorLabels, hasErrorLabel, removeLabel
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
MongoWriteConcernException
@Deprecated public MongoWriteConcernException(WriteConcernError writeConcernError, ServerAddress serverAddress) Deprecated.Construct an instance.- Parameters:
writeConcernError
- the non-null write concern errorserverAddress
- the non-null server address
-
MongoWriteConcernException
@Deprecated public MongoWriteConcernException(WriteConcernError writeConcernError, @Nullable WriteConcernResult writeConcernResult, ServerAddress serverAddress) Deprecated.Construct an instance.- Parameters:
writeConcernError
- the non-null write concern errorwriteConcernResult
- the write resultserverAddress
- the non-null server address- Since:
- 3.2
-
MongoWriteConcernException
public MongoWriteConcernException(WriteConcernError writeConcernError, @Nullable WriteConcernResult writeConcernResult, ServerAddress serverAddress, Collection<String> errorLabels) Construct an instance.- Parameters:
writeConcernError
- the non-null write concern errorwriteConcernResult
- the write resultserverAddress
- the non-null server addresserrorLabels
- the server errorLabels- Since:
- 5.0
-
-
Method Details
-
getWriteConcernError
Gets the write concern error.- Returns:
- the write concern error, which may not be null
-
getWriteResult
Gets the write result.- Returns:
- the write result
- Since:
- 3.2
-
MongoWriteConcernException(com.mongodb.bulk.WriteConcernError,com.mongodb.WriteConcernResult,com.mongodb.ServerAddress,java.util.Collection<java.lang.String>)