Skip to content

Commit

Permalink
throw illegal arg exception for search all with ammount set to zero o…
Browse files Browse the repository at this point in the history
…r less
  • Loading branch information
mdavis95 committed Feb 9, 2022
1 parent 8d37c95 commit 2ddc0f3
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,11 @@ public void queryAll(Query query, Consumer<QueryResult> resultHandler) throws Ex
}

public void searchAll(Search search, Consumer<SearchResult> resultHandler) throws Exception {

if (search.getAmount() <= 0) {
throw new IllegalArgumentException("Amount must be set to page size for search all");
}

SearchResult searchResult = search(search);
while (searchResult.hasResults()) {
resultHandler.accept(searchResult);
Expand Down

0 comments on commit 2ddc0f3

Please sign in to comment.