Package com.mongodb

Class MongoWriteConcernException

    • Constructor Detail

      • 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 Detail

      • 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