The Error
No retries:
Single request onlyQuick Fix - 1 Min
1. services.AddHttpClient<MyClient>().AddPolicyHandler(GetRetryPolicy()). 2. Policy: HttpPolicyExtensions.HandleTransientHttpError().WaitAndRetryAsync(3, i => TimeSpan.FromSeconds(Math.Pow(2,i))). 3. Order: AddPolicyHandler before AddTypedClient. 4. Check exception type: HttpRequestException only.
Root Cause
Policy not registered or handles wrong exception. Only transient errors retry.
No comments yet. Be the first to share your thoughts!