Skip to content

Commit

Permalink
Fixed aggregate limit exception handling
Browse files Browse the repository at this point in the history
  • Loading branch information
MarkMpn committed Apr 19, 2024
1 parent 9a484e9 commit 0af0563
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions MarkMpn.Sql4Cds.Engine/ExecutionPlan/FetchXmlScan.cs
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,15 @@ protected override IEnumerable<Entity> ExecuteInternal(NodeExecutionContext cont
return ((RetrieveMultipleResponse)dataSource.Execute(req)).EntityCollection;
});

task.Wait(context.Options.CancellationToken);
try
{
task.Wait(context.Options.CancellationToken);
}
catch (AggregateException ex)
{
throw ex.InnerException;
}

res = task.Result;
}
catch (FaultException<OrganizationServiceFault> ex)
Expand Down Expand Up @@ -429,7 +437,15 @@ protected override IEnumerable<Entity> ExecuteInternal(NodeExecutionContext cont
return ((RetrieveMultipleResponse)dataSource.Execute(req)).EntityCollection;
});

task.Wait(context.Options.CancellationToken);
try
{
task.Wait(context.Options.CancellationToken);
}
catch (AggregateException ex)
{
throw ex.InnerException;
}

var nextPage = task.Result;

PagesRetrieved++;
Expand Down

0 comments on commit 0af0563

Please sign in to comment.