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

Use chained errors in subscript checks #1735

Open
wants to merge 12 commits into
base: main
Choose a base branch
from
Open

Conversation

lionel-
Copy link
Member

@lionel- lionel- commented Oct 20, 2022

No description provided.

@lionel- lionel- marked this pull request as draft October 20, 2022 15:08
@lionel- lionel- changed the base branch from error-update to main October 20, 2022 16:15
@lionel- lionel- marked this pull request as ready for review October 21, 2022 12:14
@lionel- lionel- requested a review from hadley October 21, 2022 12:14
Copy link
Member

@hadley hadley left a comment

Choose a reason for hiding this comment

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

I started reviewing this overall it seems like quite a lot of work for a results that's feels to me like a net neutral (or even a slight decline, since most of the errors now need extra line). So I think I must be missing some context or motivation.

@@ -218,8 +218,9 @@
Output
<error/vctrs_error_subscript_type>
Error in `my_function()`:
! Must subset elements with a valid subscript vector.
x Can't convert from `my_arg` <double> to <integer> due to loss of precision.
! Can't subset elements with `my_arg`.
Copy link
Member

Choose a reason for hiding this comment

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

What does the chaining buy us here? Couldn't this be:

! Can't subset elements with `my_arg`.
i Can't convert from <double> to <integer> due to loss of precision.

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.

2 participants