r-lib / httr2

Make HTTP requests and process their responses. A modern reimagining of httr.
https://httr2.r-lib.org
Other
235 stars 56 forks source link

Clarify `max_tries` argument #523

Closed hadley closed 2 weeks ago

hadley commented 2 weeks ago

@jonthegeek I convinced myself that the existing behaviour is correct, it's just that you never want max_tries = 1 because 1 try = 0 retries. In hindsight, it would have been better to call this argument max_retries.

jonthegeek commented 2 weeks ago

@hadley Darnit, yes! That's what I kept slipping off of on re-reads! I should have had fixed numbers in my head (and max_tries = 1 is the easiest to reason about, or even max_tries = 0). I'm glad you got there despite my agreement with the faulty logic 🙃

I was going to come back and confirm that tests were updated to match the change, and figure out why they didn't catch the error in the first place. Turns out it was because there wasn't an error to catch!