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

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

Conversation

alec-deason
Copy link

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
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-Needs-Review The PR needs to be reviewed before it can be merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unhelpful error message with cargo metadata
2 participants