using Polly.RateLimiting;
public static void Main()
var options = new RetryStrategyOptions()
ShouldHandle = new PredicateBuilder().Handle<OperationCanceledException>(),
Console.WriteLine("retried");
var standardPredicate = options.ShouldHandle;
options.ShouldHandle = async args => await standardPredicate(args) || args.Outcome.Exception is RateLimiterRejectedException;
var pipeline = new ResiliencePipelineBuilder()
pipeline.Execute(() => throw new RateLimiterRejectedException());