Skip to content

Commit

Permalink
Merge pull request #454 from MarkMpn/executeas
Browse files Browse the repository at this point in the history
Fixed aggregate limit exception handling
  • Loading branch information
MarkMpn authored Apr 19, 2024
2 parents 748a3d0 + 0af0563 commit 87c7858
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 87c7858

Please sign in to comment.