<PackageReference Include="Polly" Version="8.4.1" />

PolicyResult<TResult>

public class PolicyResult<TResult>
The captured result of executing a policy.
public Context Context { get; }

Gets the context for this execution.

public ExceptionType? ExceptionType { get; }

Gets the exception type of the final exception captured. Will be null if policy executed successfully.

public FaultType? FaultType { get; }

Gets the fault type of the final fault captured. Will be null if policy executed successfully.

public Exception FinalException { get; }

Gets the final exception captured. Will be null if policy executed without exception.

public TResult FinalHandledResult { get; }

Gets the final handled result captured. Will be default(TResult) if the policy executed successfully, or terminated with an exception.

public OutcomeType Outcome { get; }

Gets the outcome of executing the policy.

public TResult Result { get; }

Gets the result of executing the policy. Will be default(TResult) if the policy failed.

public static PolicyResult<TResult> Failure(Exception exception, ExceptionType exceptionType, Context context)

Builds a PolicyResult representing a failed execution through the policy.

public static PolicyResult<TResult> Failure(TResult handledResult, Context context)

Builds a PolicyResult representing a failed execution through the policy.

public static PolicyResult<TResult> Successful(TResult result, Context context)

Builds a PolicyResult representing a successful execution through the policy.