static async Task ExecuteWhens(EndpointRunner endpoint, CancellationTokenSource cts) { var token = cts.Token; try { await endpoint.Whens(token).ConfigureAwait(false); } catch (Exception) { cts.Cancel(); Console.WriteLine($"Whens for endpoint {endpoint.Name()} failed to execute."); throw; } }