Skip to content

Commit

Permalink
update original err msg
Browse files Browse the repository at this point in the history
  • Loading branch information
Maya-Painter committed Aug 24, 2023
1 parent 4ecc894 commit 3c428e1
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,16 +42,6 @@ public static TryCatch<IQueryPipelineStage> MonadicCreate(
throw new ArgumentNullException(nameof(monadicCreatePipelineStage));
}

if ((continuationToken != null) && (continuationToken is CosmosElement))
{
throw new CosmosException(
"Cannot use non-aggregate continuation token with aggregate queries.",
statusCode: System.Net.HttpStatusCode.BadRequest,
subStatusCode: (int)Documents.SubStatusCodes.MalformedContinuationToken,
activityId: Guid.Empty.ToString(),
requestCharge: default);
}

TryCatch<SingleGroupAggregator> tryCreateSingleGroupAggregator = SingleGroupAggregator.TryCreate(
aggregates,
aliasToAggregateType,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ private static TryCatch<CrossFeedRangeState<QueryState>> MonadicExtractState(
{
return TryCatch<CrossFeedRangeState<QueryState>>.FromException(
new MalformedContinuationTokenException(
$"Invalid format for continuation token {continuationToken} for {nameof(ParallelCrossPartitionQueryPipelineStage)}"));
$"Invalid format for continuation token {continuationToken} for {nameof(ParallelCrossPartitionQueryPipelineStage)}. Please ensure you are using the continuation token generated by the system and for the continuation of same query as before"));
}

if (parallelContinuationTokenListRaw.Count == 0)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -919,7 +919,7 @@ public async Task LinqCountWithContinuationTokenTest()
{
Assert.IsTrue(exception.StatusCode == System.Net.HttpStatusCode.BadRequest);
Assert.IsTrue(exception.SubStatusCode == (int)Documents.SubStatusCodes.MalformedContinuationToken);
Assert.IsTrue(exception.Message.Contains("Cannot use non-aggregate continuation token with aggregate queries."));
Assert.IsTrue(exception.Message.Contains("ParallelCrossPartitionQueryPipelineStage"));
return;
}

Expand Down Expand Up @@ -964,7 +964,7 @@ public async Task LinqAverageWithContinuationTokenTest()
{
Assert.IsTrue(exception.StatusCode == System.Net.HttpStatusCode.BadRequest);
Assert.IsTrue(exception.SubStatusCode == (int)Documents.SubStatusCodes.MalformedContinuationToken);
Assert.IsTrue(exception.Message.Contains("Cannot use non-aggregate continuation token with aggregate queries."));
Assert.IsTrue(exception.Message.Contains("ParallelCrossPartitionQueryPipelineStage"));
return;
}

Expand Down

0 comments on commit 3c428e1

Please sign in to comment.