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

Readable package name parsing errors #23

Merged
merged 3 commits into from Aug 24, 2021
Merged

Conversation

magnalite
Copy link
Member

Errors during parsing of package names is confusing, see #13. This PR adds extra info to the errors output so users can understand what went wrong more easily.

Users will now see this when they have an invalid scope

failed to parse manifest at path /../../wally.toml

Caused by:
    package scope Magnalite in invalid (scopes can only contain lowercase characters, digits and '-') for key `package.name` at line 2 column 8

I'm not very happy with this but I'm not sure how else to do it. Ideally we would output multiple layers of anyhow context but this isn't easy to do as the toml parsing is what consumes the anyhow error.

@magnalite magnalite linked an issue Aug 9, 2021 that may be closed by this pull request
Copy link
Contributor

@LPGhatguy LPGhatguy left a comment

Choose a reason for hiding this comment

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

Great change! Minor typo?

src/package_name.rs Outdated Show resolved Hide resolved
@LPGhatguy LPGhatguy merged commit bd98263 into main Aug 24, 2021
@LPGhatguy LPGhatguy deleted the readable-invalid-scope-error branch August 24, 2021 00:30
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.

Capitalized package scopes give a confusing error
2 participants