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

error: Include file paths as error context; distinguish toml parsing errors from "manifest not found" #14

Merged
merged 3 commits into from
Mar 3, 2022

Conversation

MarijnS95
Copy link
Member

While implementing #12 an invalid .cargo/config.toml turned into an undescriptive and incorrect ManifestNotFound here. Forwarding the parsing error gives the user a much more descriptive error message that'll help understand what to fix.

While implementing #12 an invalid `.cargo/config.toml` turned into an
undescriptive and incorrect `ManifestNotFound` here.  Forwarding the
parsing error gives the user a much more descriptive error message
that'll help understand what to fix.
@@ -10,6 +11,7 @@ pub enum Error {
RustcNotFound,
Io(IoError),
GlobPatternError(&'static str),
Toml(PathBuf, TomlError),
Copy link
Member Author

Choose a reason for hiding this comment

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

@dvc94ch Before merging this, shall I do the same for at least IoError? It's a bit annoying to see "No such file or directory" without knowing what the path was.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Sounds good. Wish io errors were more descriptive by default.

Copy link
Member Author

Choose a reason for hiding this comment

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

Done! Would you mind reviewing+merging this and #13? I'll update #12 after that with some fixes.

@MarijnS95 MarijnS95 changed the title error: Distinguish toml parsing errors from "manifest not found" error: Include file paths as error context; distinguish toml parsing errors from "manifest not found" Mar 3, 2022
Copy link
Collaborator

@dvc94ch dvc94ch left a comment

Choose a reason for hiding this comment

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

Neat, thanks!

@MarijnS95 MarijnS95 merged commit 7166d6f into master Mar 3, 2022
@MarijnS95 MarijnS95 deleted the toml-parsing-error branch March 3, 2022 16:35
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.

2 participants