Package com.mongodb

Class MongoWriteConcernException

All Implemented Interfaces:
Serializable

public class MongoWriteConcernException extends MongoServerException
An exception indicating a failure to apply the write concern to the requested write operation
Since:
3.0
See Also:
  • Constructor Details

    • MongoWriteConcernException

      public MongoWriteConcernException(WriteConcernError writeConcernError, ServerAddress serverAddress)
      Construct an instance.
      Parameters:
      writeConcernError - the non-null write concern error
      serverAddress - the non-null server address
    • MongoWriteConcernException

      public MongoWriteConcernException(WriteConcernError writeConcernError, @Nullable WriteConcernResult writeConcernResult, ServerAddress serverAddress)
      Construct an instance.
      Parameters:
      writeConcernError - the non-null write concern error
      writeConcernResult - the write result
      serverAddress - the non-null server address
      Since:
      3.2
  • Method Details

    • addLabel

      public void addLabel(String errorLabel)
      Description copied from class: MongoException
      Adds the given error label to the exception.
      Overrides:
      addLabel in class MongoException
      Parameters:
      errorLabel - the non-null error label to add to the exception
    • getWriteConcernError

      public WriteConcernError getWriteConcernError()
      Gets the write concern error.
      Returns:
      the write concern error, which may not be null
    • getWriteResult

      public WriteConcernResult getWriteResult()
      Gets the write result.
      Returns:
      the write result
      Since:
      3.2