Throw classed error if allow_empty = FALSE
+ add more context to error message by adding error_arg
to eval_select()
#350
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #347
basically implement what was raised in #282 (comment)
Addresses part of #327
I have to say this fix is a bit naive and narrow and lacks a more general view.
Created on 2024-04-25 with reprex v2.1.0
Would it make sense to recognize it in
eval_relocate()
?A version I had locally had
error_arg = c(before_arg, after_arg)
, but couldn't tell if it was useful.This implementation doesn't change the default, which mean it is opt-in.
Reason behind.
I was working on gt and discovered
allow_empty
and I thought I'd use it to throw messages, (without having to rethrow it again)But I found that the error message Can't select empty items was not informative at all, so it is required to rethrow it or make tweaks in tidyselect.
So I thought it would be great if tidyselect had a mechanism to do this, and discovered it was proposed last time tidyselect was updated, but was never implemented.