Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Docs]: Need to update roxygen @param tag for the after arg of req_retry #597

Closed
jimbrig opened this issue Dec 17, 2024 · 1 comment
Closed
Milestone

Comments

@jimbrig
Copy link
Contributor

jimbrig commented Dec 17, 2024

I noticed the source code for req_retry is updated and now the after argument's callback function wants either NA or a number instead of the previous NULL.

To avoid confusion, the roxygen2 @param docs for the after argument should be updated to reflect this change:

Reference:

Error received:

Error in `httr2::req_perform()`:
! The `after` callback to `req_retry()` must return a single number or NA, not `NULL`.
Run `rlang::last_trace()` to see where the error occurred.

Current @param tag for the after argument of req_retry:

#' @param after A function that takes a single argument (the response) and
#'   returns either a number of seconds to wait or `NULL`, which indicates
#'   that a precise wait time is not available that the `backoff` strategy
#'   should be used instead..

should now be:

#' @param after A function that takes a single argument (the response) and
#'   returns either a number of seconds to wait or `NA`, which indicates
#'   that a precise wait time is not available that the `backoff` strategy
#'   should be used instead.

(changing NULL to NA)

@jimbrig
Copy link
Contributor Author

jimbrig commented Dec 17, 2024

made a quick PR: #598

not sure if you want to keep like this or maybe adjust the function to be numeric or NA or NULL?

regardless, appreciate the amazing job with this library! much smoother developer experience than the original httr library!

@hadley hadley added this to the v1.1.0 milestone Dec 19, 2024
@hadley hadley closed this as completed in 4e641f8 Dec 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants