diff --git a/Library/PartialLoader.cs b/Library/PartialLoader.cs index 4d6e483..7d39ad5 100644 --- a/Library/PartialLoader.cs +++ b/Library/PartialLoader.cs @@ -596,7 +596,10 @@ private void PrepareToExecute() _loadTask = Task.Run(async () => { - await foreach (T item in _dataProvider!.ConfigureAwait(false)) + await foreach ( + T item in _dataProvider! + .ConfigureAwait(false) + ) { if (_cancellationTokenSource.Token.IsCancellationRequested) { @@ -605,9 +608,13 @@ private void PrepareToExecute() _queue.Enqueue(item); _manualReset.Set(); } - }).ContinueWith(_ => + }).ContinueWith(t => { _manualReset.Set(); + if (t.IsFaulted) + { + throw t.Exception; + } }); }