Table of Contents

Method When

Namespace
Velvet
Assembly
Velvet.Docs.dll

When(Func<int, Exception, bool>)

Decides from the number of failures before this one and this failure's exception whether to retry. The function replaces a count rather than narrowing one, so it alone ends the retries: one that always accepts retries without end.

public static RetryRule When(Func<int, Exception, bool> shouldRetry)

Parameters

shouldRetry Func<int, Exception, bool>

Returns

RetryRule

Exceptions

ArgumentNullException

shouldRetry is null.