Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Query: Fixes order by logic to throw original exception instead of AggregateException #2708

Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public OrderByQueryPartitionRangePageAsyncEnumerator(
SqlQuerySpec sqlQuerySpec,
FeedRangeState<QueryState> feedRangeState,
PartitionKey? partitionKey,
QueryPaginationOptions queryPagingationOptions,
QueryPaginationOptions queryPaginationOptions,
string filter,
CancellationToken cancellationToken)
: base(feedRangeState, cancellationToken)
Expand All @@ -33,7 +33,7 @@ public OrderByQueryPartitionRangePageAsyncEnumerator(
sqlQuerySpec,
feedRangeState,
partitionKey,
queryPagingationOptions,
queryPaginationOptions,
filter,
cancellationToken);
this.bufferedEnumerator = new BufferedPartitionRangePageAsyncEnumerator<OrderByQueryPage, QueryState>(
Expand Down Expand Up @@ -107,16 +107,15 @@ protected override Task<TryCatch<OrderByQueryPage>> GetNextPageAsync(ITrace trac
cancellationToken)
.ContinueWith<TryCatch<OrderByQueryPage>>(antecedent =>
j82w marked this conversation as resolved.
Show resolved Hide resolved
{
TryCatch<QueryPage> monadicQueryPage = antecedent.Result;
TryCatch<QueryPage> monadicQueryPage = antecedent.GetAwaiter().GetResult();
if (monadicQueryPage.Failed)
{
Console.WriteLine(this.SqlQuerySpec);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👀

return TryCatch<OrderByQueryPage>.FromException(monadicQueryPage.Exception);
}

QueryPage queryPage = monadicQueryPage.Result;
return TryCatch<OrderByQueryPage>.FromResult(new OrderByQueryPage(queryPage));
});
}, cancellationToken);
}
}
}
Expand Down