Skip to content

Commit 214520d

Browse files
committed
Better handle faults and cancelations from data source
1 parent cb00c1d commit 214520d

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

Microsoft.Toolkit.Uwp/IncrementalLoadingCollection/IncrementalLoadingCollection.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,12 @@ protected virtual async Task<IEnumerable<IType>> LoadDataAsync(CancellationToken
232232
.ContinueWith(
233233
t =>
234234
{
235-
if (t.Status == TaskStatus.RanToCompletion)
235+
if(t.IsFaulted)
236+
{
237+
throw t.Exception;
238+
}
239+
240+
if (t.IsCompletedSuccessfully)
236241
{
237242
CurrentPageIndex += 1;
238243
}

0 commit comments

Comments
 (0)