Package com.mongodb
Class MongoBulkWriteException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
com.mongodb.MongoException
com.mongodb.MongoServerException
com.mongodb.MongoBulkWriteException
- All Implemented Interfaces:
Serializable
An exception that represents all errors associated with a bulk write operation.
- Since:
- 3.0
-
Field Summary
Fields inherited from class com.mongodb.MongoException
TRANSIENT_TRANSACTION_ERROR_LABEL, UNKNOWN_TRANSACTION_COMMIT_RESULT_LABEL
-
Constructor Summary
ConstructorDescriptionMongoBulkWriteException
(BulkWriteResult writeResult, List<BulkWriteError> writeErrors, WriteConcernError writeConcernError, ServerAddress serverAddress) Deprecated.MongoBulkWriteException
(BulkWriteResult writeResult, List<BulkWriteError> writeErrors, WriteConcernError writeConcernError, ServerAddress serverAddress, Set<String> errorLabels) Constructs a new instance. -
Method Summary
Modifier and TypeMethodDescriptionboolean
The address of the server which performed the bulk write operation.The write concern error, which may be null (in which case the list of errors will not be empty).The list of errors, which will not be null, but may be empty (if the write concern error is not null).The result of all successfully processed write operations.int
hashCode()
Methods inherited from class com.mongodb.MongoServerException
getErrorCodeName
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
-
MongoBulkWriteException
@Deprecated public MongoBulkWriteException(BulkWriteResult writeResult, List<BulkWriteError> writeErrors, @Nullable WriteConcernError writeConcernError, ServerAddress serverAddress) Deprecated.Constructs a new instance.- Parameters:
writeResult
- the write resultwriteErrors
- the list of errorswriteConcernError
- the write concern errorserverAddress
- the server address.
-
MongoBulkWriteException
public MongoBulkWriteException(BulkWriteResult writeResult, List<BulkWriteError> writeErrors, @Nullable WriteConcernError writeConcernError, ServerAddress serverAddress, Set<String> errorLabels) Constructs a new instance.- Parameters:
writeResult
- the write resultwriteErrors
- the list of errorswriteConcernError
- the write concern errorserverAddress
- the server address.errorLabels
- any server errorLabels- Since:
- 4.1
-
-
Method Details
-
getWriteResult
The result of all successfully processed write operations. This will never be null.- Returns:
- the bulk write result
-
getWriteErrors
The list of errors, which will not be null, but may be empty (if the write concern error is not null).- Returns:
- the list of errors
-
getWriteConcernError
The write concern error, which may be null (in which case the list of errors will not be empty).- Returns:
- the write concern error
-
getServerAddress
The address of the server which performed the bulk write operation.- Overrides:
getServerAddress
in classMongoServerException
- Returns:
- the address
-
equals
-
hashCode
public int hashCode()
-
MongoBulkWriteException(BulkWriteResult, List, WriteConcernError, ServerAddress, Set)
instead