Struct HandlingClause

Namespace
Kevlar
Assembly
Kevlar.dll

Decides whether an outcome is a handled failure. Custom reactive strategies receive the active clause through a Use factory and should consult it instead of duplicating filters.

public readonly struct HandlingClause
Inherited Members

Properties

Default

The default handling clause: ordinary errors, excluding cancellation, Kevlar fail-fast rejections, and fatal runtime exceptions.

public static HandlingClause Default { get; }

Property Value

HandlingClause

IsContextAware

Whether this clause consults execution or strategy context.

public bool IsContextAware { get; }

Property Value

bool

Methods

ShouldHandle<T>(in Outcome<T>)

Returns whether outcome is a handled failure.

public bool ShouldHandle<T>(in Outcome<T> outcome)

Parameters

outcome Outcome<T>

Returns

bool

Type Parameters

T

Remarks

This context-free overload cannot report predicate failures through execution diagnostics. Reactive strategies should use the overload that accepts KevlarContext.

ShouldHandle<T>(in Outcome<T>, KevlarContext, int, int)

Returns whether an outcome is handled for the active execution and strategy.

public bool ShouldHandle<T>(in Outcome<T> outcome, KevlarContext context, int attemptNumber = 0, int strategyIndex = -1)

Parameters

outcome Outcome<T>
context KevlarContext
attemptNumber int
strategyIndex int

Returns

bool

Type Parameters

T