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

fix(pkg): improve locations of conversion errors #8828

Merged

Conversation

rgrinberg
Copy link
Member

We don't have the exact locations, but we can at least point to the
relevant files.

Signed-off-by: Rudi Grinberg me@rgrinberg.com

@rgrinberg rgrinberg force-pushed the ps/rr/fix_pkg___improve_locations_of_conversion_errors branch from 9b7b705 to 3dd00a1 Compare October 3, 2023 14:05
@Alizter
Copy link
Collaborator

Alizter commented Oct 3, 2023

Can you add a test so we can see what it looks like?

@rgrinberg rgrinberg force-pushed the ps/rr/fix_pkg___improve_locations_of_conversion_errors branch 2 times, most recently from 6cadfac to 6d0941f Compare October 3, 2023 15:27
@rgrinberg rgrinberg force-pushed the ps/rr/fix_pkg___improve_locations_of_conversion_errors branch from 6d0941f to 416475a Compare October 3, 2023 15:34
We don't have the exact locations, but we can at least point to the
relevant files.

Signed-off-by: Rudi Grinberg <me@rgrinberg.com>

<!-- ps-id: d0bf377b-7729-4f6c-a42c-897e2b3b6f82 -->
@rgrinberg rgrinberg force-pushed the ps/rr/fix_pkg___improve_locations_of_conversion_errors branch from 416475a to 8922377 Compare October 3, 2023 21:57
@rgrinberg
Copy link
Member Author

ping @Leonidas-from-XIV

@Alizter
Copy link
Collaborator

Alizter commented Oct 4, 2023

I still think it might be good to provide the package name and version in the message and not just the location.

@rgrinberg
Copy link
Member Author

How would that information help? It's irrelevant to the error itself, therefore distracting. More is not better when it comes to error messages.

Copy link
Collaborator

@Leonidas-from-XIV Leonidas-from-XIV left a comment

Choose a reason for hiding this comment

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

Looks good. The only concern I have is that the filename to the offending file might not be a particularly useful one, especially if it is read from a checkout in a cache directory or from a git object.

But lets not get future concerns prevent current improvements.

@rgrinberg
Copy link
Member Author

Indeed, that's a good point. We could still be more helpful in such situations by including the commit, the repository URL, and the path. So at least the user knows where to find the file. We could even copy the file to a temporary directory.

@rgrinberg rgrinberg merged commit 4fee0ee into main Oct 5, 2023
23 checks passed
@rgrinberg rgrinberg deleted the ps/rr/fix_pkg___improve_locations_of_conversion_errors branch October 5, 2023 13:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants