Skip to content

Conversation

magnalite
Copy link
Contributor

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?

@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