Skip to content

Improve error messages for io::fs #14629

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

Closed
wants to merge 1 commit into from

Conversation

wycats
Copy link
Contributor

@wycats wycats commented Jun 3, 2014

This commit improves the error descriptions and details for the functions and methods exposed in io::fs.

The basic idea is that the description should always map onto the high-level operation that the user was trying to perform, with the detail containing the original message. The IoErrorKind is always maintained. The detail also includes additional information (most notably the relevant path, but also other parameters or contextual information).

I added an UpdateIoError trait to make it easier to do these in-place modification, and I'm eager for feedback on the specific strategy.

@@ -134,6 +135,8 @@ impl File {
last_nread: -1
}
})
}).update_err("Couldn't open file", |e| {
Copy link
Member

Choose a reason for hiding this comment

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

Our convention, at least for the compiler, is to start with lowercase letters as opposed to uppercase letters.

@wycats
Copy link
Contributor Author

wycats commented Jun 6, 2014

I believe I have responded to all of your comments. 😄

@alexcrichton
Copy link
Member

I'll rebase and take over from here (talked with @wycats on IRC)

bors added a commit to rust-lang-ci/rust that referenced this pull request Jun 5, 2023
internal: Add some additional status ouput

We should be able to use this infra to get a better grasp about what we might want to LRU
bors pushed a commit to rust-lang-ci/rust that referenced this pull request Apr 22, 2025
- Do not replace macro results in then/else branches
- Extract condition snippet from the right context
- Make suggestion `MaybeIncorrect` if it would lead to losing comments

changelog: [`bool_to_int_with_if`]: properly handle macros

Fixes rust-lang/rust-clippy#14628
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.

4 participants