-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Provide more detailed I/O errors #7269
Comments
Hi! I'm just chipping in because I wrote the If you have a better idea to be smarter about this, I'd love to hear it though! |
I recently refactored the I/O errors in nushell#14927 to provide exactly this necessary information. And yeah, we also had to extend the Just now with the direction to replace our filesystem commands with the uutils ones, we lose that information again. :/ |
Sounds good! Feel free to ping me if you want to discuss changes you'd like to make. |
I think similar to the Nushell pub struct UIoError {
// hold the inner io error to extract further data from it later on
inner: std::io::Error,
// reference a path that caused the error
path: Option<std::path::PathBuf>,
// an index to which path failed, `cp` or `mv` need two paths
path_index: usize,
// additional context if that is useful
additional_context: Option<String>,
} But I'm not really sure about the |
@tertsdiepraam I need some guidance about the |
The
UIoError
only contains anstd::io::Error
and some context and both aren't really accessible. For people that useuucore
as a library that makes it very hard to build good errors from that. It would be really nice if that error type could expose thestd::io::Error
, a path that failed if it happened at some path and maybe even an index for commands that take multiple paths likecp
ormv
. I think restructuringUIoError
s in that direction would also harmonize error messages across the different binaries and you maybe don't need to use as many custom contexts anymore.The text was updated successfully, but these errors were encountered: