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

Surface invalid metadata as hints in error reports #2850

Merged
merged 1 commit into from
Apr 10, 2024
Merged

Conversation

charliermarsh
Copy link
Member

Summary

Closes #2847.

@charliermarsh charliermarsh added the error messages Messaging when something goes wrong label Apr 6, 2024
@charliermarsh charliermarsh marked this pull request as ready for review April 6, 2024 14:58
@charliermarsh charliermarsh changed the title Surface invalid metadata as hints in erro reports Surface invalid metadata as hints in error reports Apr 6, 2024
MetadataResponse::InvalidStructure(err) => {
self.unavailable_packages.insert(
package_name.clone(),
UnavailablePackage::InvalidStructure(err.to_string()),
Copy link
Member Author

Choose a reason for hiding this comment

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

It's confusing but for URLs, we don't have a version... so both UnavailablePackage and IncompletePackage have an InvalidStructure and InvalidMetadata variant.

write!(
f,
"{}{} Metadata for {} could not be parsed:\n{}",
"hint".bold().cyan(),
Copy link
Member

Choose a reason for hiding this comment

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

Nit: Can we move the hint: outside the match?

@charliermarsh charliermarsh merged commit 7ae06b3 into main Apr 10, 2024
35 checks passed
@charliermarsh charliermarsh deleted the charlie/extra branch April 10, 2024 03:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
error messages Messaging when something goes wrong
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Show "invalid metadata" errors as hints on resolution failure
3 participants