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
ExceptionType
The exception type of the final exception captured. Will be null if policy executed successfully
public ExceptionType? ExceptionType { get; }
Property Value
FaultType
The fault type of the final fault captured. Will be null if policy executed successfully
public FaultType? FaultType { get; }
Property Value
FinalException
The final exception captured. Will be null if policy executed without exception.
public Exception FinalException { get; }
Property Value
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
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
ExceptionThe exception
exceptionType
ExceptionTypeThe exception type
context
ContextThe 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
TResultThe result returned by execution through the policy, which was treated as a handled failure
context
ContextThe 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
TResultThe result returned by execution through the policy
context
ContextThe policy execution context
Returns
- PolicyResult<TResult>
A PolicyResult representing a successful execution through the policy.