Skip to content

Conversation

@hadley
Copy link
Member

@hadley hadley commented Nov 14, 2023

Fixes #385

Copy link
Contributor

@jonthegeek jonthegeek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clear error messages are very helpful!

if (!is_number_or_na(after)) {
not <- obj_type_friendly(after)
cli::cli_abort(
"The {.code after} callback to {.fn req_retry} must return a single number or NA, not {not}.",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Out of curiosity, why not, vs this?

Suggested change
"The {.code after} callback to {.fn req_retry} must return a single number or NA, not {not}.",
"The {.code after} callback to {.fn req_retry} must return a single number or NA, not {.obj_type_friendly {after}}.",

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just to make the lines shorter.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aha! I thought that might be it, but the GitHub web UI made it not look THAT long. Glad to know I wasn't missing something!

@hadley hadley merged commit 9b4956a into main Nov 14, 2023
@hadley hadley deleted the check-after branch November 14, 2023 19:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Error in check_number() when using Req_retry()

3 participants