Skip to content

Commit

Permalink
Throw error explicitly on param value not in range (apache#3950)
Browse files Browse the repository at this point in the history
  • Loading branch information
shiv4289 authored and merlimat committed Apr 1, 2019
1 parent e36ae70 commit daa0a18
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,9 @@ public PulsarSourceBuilder<T> subscriptionName(String subscriptionName) {
public PulsarSourceBuilder<T> acknowledgementBatchSize(long size) {
if (size > 0 && size <= MAX_ACKNOWLEDGEMENT_BATCH_SIZE) {
acknowledgementBatchSize = size;
return this;
}
return this;
throw new IllegalArgumentException("acknowledgementBatchSize can only take values > 0 and <= " + MAX_ACKNOWLEDGEMENT_BATCH_SIZE);
}

public SourceFunction<T> build() {
Expand Down

0 comments on commit daa0a18

Please sign in to comment.