ExceptionMappingBehavior(Func<Exception, Exception?>, Boolean, DefaultValueProvider?) Constructor

Definition

Namespace Stunts
Assembly Stunts.dll

Initializes the behavior.

public ExceptionMappingBehavior(Func<Exception, Exception?> map, bool swallow = false, DefaultValueProvider? defaults = null)

Parameters

map
Func<Exception, Exception?>

Translates the failure. Return null to leave the exception unchanged, or another instance to replace it. When swallow is true, null completes the call with the DefaultValueProvider value.

swallow
Boolean

When true, a null map result turns the failure into the DefaultValueProvider value. Defaults to false.

defaults
DefaultValueProvider

Supplies the swallowed value. Pass the provider that already has custom defaults registered. null uses a new DefaultValueProvider.