0

Following from Set a default Polly policy with Flurl

How do I use Polly with Flurl without the factory? This only calls it once

string s = await Policy
                        .Handle<HttpRequestException> ()
                        .OrResult <HttpResponseMessage> (r => !r.IsSuccessStatusCode)
                        .RetryAsync (5)
                        .ExecuteAsync (() => { Console.WriteLine ("Retry"); return "http://127.0.0:7071/".GetAsync (); })
                        .ReceiveString ()
                        .ConfigureAwait (false);
Robin
  • 451
  • 3
  • 14
  • 2
    Have you tried `Handle` instead? That is what you want to catch in this scenario instead of `HttpRequestException`. I might not have explained that very well in the comments in the question you linked to. – Todd Menier Apr 17 '19 at 23:54
  • ok, got it working. thanks – Robin Apr 18 '19 at 04:13
  • 1
    @Robin why don't you answer your own question so that other people can learn – Luke Sep 28 '22 at 11:13

0 Answers0