diff --git a/src/Cake.Parallel/ParallelCakeEngine.cs b/src/Cake.Parallel/ParallelCakeEngine.cs index 9197367..1020c41 100644 --- a/src/Cake.Parallel/ParallelCakeEngine.cs +++ b/src/Cake.Parallel/ParallelCakeEngine.cs @@ -296,7 +296,10 @@ private void ReportErrors(IExecutionStrategy strategy, Action errorRe { strategy.ReportErrors(errorReporter, taskException); } - catch { } + catch + { + // Intentionally suppressed: if error reporting itself fails, there is nothing more we can do. + } } private void HandleErrors(IExecutionStrategy strategy, Action errorHandler, Exception exception) diff --git a/src/Cake.Parallel/ParallelGraphBuilder.cs b/src/Cake.Parallel/ParallelGraphBuilder.cs index dd9e4ee..3c87a0a 100644 --- a/src/Cake.Parallel/ParallelGraphBuilder.cs +++ b/src/Cake.Parallel/ParallelGraphBuilder.cs @@ -8,7 +8,7 @@ namespace Cake.Parallel.Module { - public class ParallelGraphBuilder + public static class ParallelGraphBuilder { public static CakeGraph Build(List tasks) { diff --git a/src/Cake.Parallel/ParallelGraphExtensions.cs b/src/Cake.Parallel/ParallelGraphExtensions.cs index 23ced0e..62a9964 100644 --- a/src/Cake.Parallel/ParallelGraphExtensions.cs +++ b/src/Cake.Parallel/ParallelGraphExtensions.cs @@ -51,7 +51,7 @@ private static async Task Traverse( } // The below line does work correctly, but does not bubble up the TaskCanceledException - // await executeTask(nodeName, cancellationTokenSource).ConfigureAwait(false); + await Task.Run(() => executeTask(nodeName, cancellationTokenSource), token).ConfigureAwait(false); }