Table of Contents

Class PolicyResult<TResult>

Namespace
Polly
Assembly
Polly.dll

The captured result of executing a policy

public class PolicyResult<TResult>

Type Parameters

TResult
Inheritance
PolicyResult<TResult>
Inherited Members

Properties

Context

The context for this execution.

public Context Context { get; }

Property Value

Context

ExceptionType

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

public ExceptionType? ExceptionType { get; }

Property Value

ExceptionType?

FaultType

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

public FaultType? FaultType { get; }

Property Value

FaultType?

FinalException

The final exception captured. Will be null if policy executed without exception.

public Exception FinalException { get; }

Property Value

Exception

FinalHandledResult

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

public TResult FinalHandledResult { get; }

Property Value

TResult

Outcome

The outcome of executing the policy

public OutcomeType Outcome { get; }

Property Value

OutcomeType

Result

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

public TResult Result { get; }

Property Value

TResult

Methods

Failure(Exception, ExceptionType, Context)

Builds a PolicyResult representing a failed execution through the policy.

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

Parameters

exception Exception

The exception

exceptionType ExceptionType

The exception type

context Context

The policy execution context

Returns

PolicyResult<TResult>

A PolicyResult representing a failed execution through the policy.

Failure(TResult, Context)

Builds a PolicyResult representing a failed execution through the policy.

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

Parameters

handledResult TResult

The result returned by execution through the policy, which was treated as a handled failure

context Context

The policy execution context

Returns

PolicyResult<TResult>

A PolicyResult representing a failed execution through the policy.

Successful(TResult, Context)

Builds a PolicyResult representing a successful execution through the policy.

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

Parameters

result TResult

The result returned by execution through the policy

context Context

The policy execution context

Returns

PolicyResult<TResult>

A PolicyResult representing a successful execution through the policy.