Azure / azure-cosmosdb-java

Java Async SDK for SQL API of Azure Cosmos DB
MIT License
54 stars 61 forks source link

Removed BadRequestException when FeedOptions.maxItemCount is -1 #264

Closed kushagraThapar closed 4 years ago

kushagraThapar commented 4 years ago

This PR fixes the issue of SDK throwing BadRequestException when maxItemCount is less than 0. https://github.com/Azure/azure-cosmosdb-java/issues/261

kushagraThapar commented 4 years ago

thanks for fixing it. You could avoid the outer "if", might be more readable this way.

BadRequestException validationError = Utils.checkRequestOrReturnException(
    initialPageSize > 0 || initialPageSize == -1, "MaxItemCount", "Invalid MaxItemCount %s", initialPageSize);
if (validationError != null) {
    return Observable.error(validationError);
}

Yes, that seems good as well, I will do that.

kushagraThapar commented 4 years ago

Timeout issues, merging the PR as the change is unrelated to the timeout issues.