pulumi/sdk/dotnet/Pulumi.Automation/PulumiFn.TStack.cs
Josh Studt 22669d70fc
[sdk/dotnet] - Fix swallowed nested exceptions with inline program so they correctly bubble to consumer (#7323)
* resolve issue with exit code not bubbling up and inflight tasks swallowing exceptions

* update changelog

* refacter to reduce and centralize inline program exception flow complexity

* quick comments on new pulumi function return type
2021-06-21 15:45:26 -04:00

23 lines
580 B
C#

// Copyright 2016-2021, Pulumi Corporation
using System;
using System.Threading;
using System.Threading.Tasks;
namespace Pulumi.Automation
{
internal class PulumiFn<TStack> : PulumiFn where TStack : Stack
{
private readonly Func<TStack> _stackFactory;
public PulumiFn(Func<TStack> stackFactory)
{
this._stackFactory = stackFactory;
}
/// <inheritdoc/>
internal override Task<int> InvokeAsync(IRunner runner, CancellationToken cancellationToken)
=> runner.RunAsync(this._stackFactory);
}
}