Remove redundant message if an error occurs during package extraction#3464
Conversation
djc
left a comment
There was a problem hiding this comment.
So yes, for that specific ENOSPC error it would still make sense. My question is if there are other potential errors for unpack_without_first_dir() that might be indirectly caused by a lack of disk space, which could still benefit from the existing hint?
|
The hint was added in https://github.com/rust-lang/rustup/pull/2721/files#diff-47e56d6d43f3702f3f6de0b34ad1988bcccfdba0d493fdfa247c8fd544195327R153, which is sort of generic (conversion to anyhow), so it doesn't necessarily look like there was a specific reason to add this there? |
|
Possible errors are return immediately, I think this should be obvious, except for these lines: rustup/src/dist/component/package.rs Line 314 in a4dd7d0 rustup/src/dist/component/package.rs Line 358 in a4dd7d0 rustup/src/dist/component/package.rs Line 493 in a4dd7d0 rustup/src/dist/component/package.rs Line 517 in a4dd7d0 The Lines 187 to 210 in a4dd7d0 The |
djc
left a comment
There was a problem hiding this comment.
It does seem fair to conclude that this is not the right place to narrow the context to suggest ENOSPC if that is necessary at all. Given that was added in a commit that was arguably unrelated, I think it makes sense to remove it all, though maybe @rbtcollins remembers why he thought adding it here was useful.
This is the message when there is an error on extracting, it does contain the source of the cause. For example, when out of space on extraction:
This PR remove the message in parentheses like this:
Note: the error message already contains the source of cause by the selector "{:#}" in
cli::common::report_error.See also: https://docs.rs/anyhow/latest/anyhow/struct.Error.html#display-representations