-
Notifications
You must be signed in to change notification settings - Fork 130
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
Review all error messages #659
Comments
vctrs::vec_as_position(100, length(mtcars), names = names(mtcars))
#> Error: Must index existing elements.
#> x Can't subset position 100.
#> i There are only 11 elements.
vctrs::vec_as_position("foo", length(mtcars), names = names(mtcars))
#> Error: Must index existing elements.
#> x Can't subset element with unknown name `foo`.
vctrs::vec_as_position(new.env(), length(mtcars), names = names(mtcars))
#> Error: Must extract with a single position or name.
#> x `i` has the wrong type `environment`.
#> i Positions and names must be integer or character.
vctrs::vec_as_position(factor("cyl"), length(mtcars), names = names(mtcars))
#> [1] 2 |
Thanks. Is there a way to replace "elements" by "columns" in the error messages? I remember a solution to a similar problem in tidyselect. |
We have decided to use a generic "element" for simplicity (for now at least). |
You can now override The issue message should probably be as consistent as possible as the parent error's. |
Relevant: tidyverse/design#100. |
@lionel-: If we create a condition from a parent condition, is it good practice to copy over the detail information from the parent condition (such as |
- Using classed conditions. All classes start with `"tibble_error_"` and also contain `"tibble_error"` (#659).
- Add proper error messages everywhere, avoid "could not find function error_xxx()" errors (#659).
I think the better practice is to implement bullets methods that forwards to the parent. But we are only discovering these things :) We don't have a |
Thanks. I'd rather not have any methods for condition classes, they clutter |
I don't think cluttering NAMESPACE should be a concern in any circumstance though. Unlike the pkgdown reference, which is easy to free of clutter. |
This old thread has been automatically locked. If you think you have found something related to this, please open a new issue and link to this old issue if necessary. |
Refactor
Add new
expect_error_relax()
verify_output()
for invariantsThe text was updated successfully, but these errors were encountered: