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);
Handle<FlurlHttpException>
instead? That is what you want to catch in this scenario instead ofHttpRequestException
. I might not have explained that very well in the comments in the question you linked to. – Merras