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

Make errors more informative when cargo metadata fails #260

Merged
merged 5 commits into from
Feb 8, 2025

Conversation

alec-deason
Copy link
Contributor

When the a call to cargo metadata fails the only output the user sees is "Error: EOF while parsing a value at line 1 column 0" which doesn't explain anything. This change adds additional context.

I have made the choice to try to print stderr if it can be decoded as utf-8 because that is where I believe all the useful stuff will always be. If decoding fails I print the debug format for the Output struct which will at least have some information.

fixes: #242

@BD103 BD103 requested a review from TimJentzsch February 5, 2025 14:38
@BD103 BD103 added A-CLI Related to the main CLI and not a more specific subcommand C-Usability An improvement that makes the API more pleasant S-Needs-Review The PR needs to be reviewed before it can be merged labels Feb 5, 2025
Copy link
Member

@BD103 BD103 left a comment

Choose a reason for hiding this comment

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

I'm happy with the changes here! Just run cargo fmt, then I'll merge this :)

@BD103 BD103 added S-Waiting-on-Author The author needs to make changes or address concerns before this can be merged and removed S-Needs-Review The PR needs to be reviewed before it can be merged labels Feb 7, 2025
@TimJentzsch TimJentzsch enabled auto-merge (squash) February 8, 2025 13:53
@TimJentzsch TimJentzsch merged commit 6f2fb0c into TheBevyFlock:main Feb 8, 2025
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-CLI Related to the main CLI and not a more specific subcommand C-Usability An improvement that makes the API more pleasant S-Waiting-on-Author The author needs to make changes or address concerns before this can be merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unhelpful error message with cargo metadata
3 participants