Skip to content
This repository was archived by the owner on Jun 21, 2023. It is now read-only.

Commit 1dbc907

Browse files
committed
Throw when loading a page fails.
`Task.WhenAny` doesn't not throw exceptions when one of the tasks it's awaiting throws. Need to do that manually.
1 parent c533d30 commit 1dbc907

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/GitHub.App/Collections/SequentialListSource.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,12 @@ async Task<Page<TModel>> EnsureLoaded(int pageNumber)
146146
}
147147
}
148148

149-
await Task.WhenAny(loading, pageLoaded).ConfigureAwait(false);
149+
var completed = await Task.WhenAny(loading, pageLoaded).ConfigureAwait(false);
150+
151+
if (completed.IsFaulted)
152+
{
153+
throw completed.Exception;
154+
}
150155

151156
if (pageLoaded.IsCompleted)
152157
{

0 commit comments

Comments
 (0)