mirror of https://github.com/winsw/winsw
Update downloading
parent
ad329b60ca
commit
bf09ea36f9
|
@ -211,7 +211,13 @@ namespace winsw
|
|||
tasks[i] = download.PerformAsync();
|
||||
}
|
||||
|
||||
Task.WhenAll(tasks);
|
||||
try
|
||||
{
|
||||
Task.WaitAll(tasks);
|
||||
}
|
||||
catch (AggregateException e)
|
||||
{
|
||||
List<Exception> exceptions = new List<Exception>(e.InnerExceptions.Count);
|
||||
for (int i = 0; i < tasks.Length; i++)
|
||||
{
|
||||
if (tasks[i].IsFaulted)
|
||||
|
@ -225,10 +231,13 @@ namespace winsw
|
|||
// TODO: move this code into the download logic
|
||||
if (download.FailOnError)
|
||||
{
|
||||
throw new IOException(errorMessage, exception);
|
||||
exceptions.Add(new IOException(errorMessage, exception));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
throw new AggregateException(exceptions);
|
||||
}
|
||||
#else
|
||||
foreach (Download download in _descriptor.Downloads)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue