-
Notifications
You must be signed in to change notification settings - Fork 469
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
feat: show IO errors for files in the UI #1311
Conversation
This actually accidentally partially fixes #1273, too. Turns out there was The loading message still doesn't work in the folder preview view ( |
pub enum FolderStage { | ||
#[default] | ||
Loading, | ||
Loaded, | ||
Failed(std::io::ErrorKind), | ||
Failed(std::io::ErrorKind, String), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why don't we generate error messages through std::io::ErrorKind
instead of saving them as strings?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There doesn't seem to be any way to do that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about using the Display
trait to do this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That doesn't give the pretty human readable messages, just the name of the kind.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The error messages for the two cases NotFound
and PermissionDenied
are "entity not found" and "permission denied", which I think are quite readable. What does the current implementation look like?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The error strings in the current commit are the classic C / POSIX error messages with the os error code, e.g. "No such file or directory (os error 2)" or "Permission denied (os error 13)". I wanted to use these since they seem familiar and are easy to search details for especially when you encounter a rarer type of error that you might not understand.
However, I guess the ErrorKind strings are actually good enough and it makes the implementation simpler.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
However, I guess the ErrorKind strings are actually good enough and it makes the implementation simpler.
Nice, please change it! Let's implement it in the simplest way for now, if someone reports that it's not clear enough, we can create our own messages by ErrorKind
.
33d04f9
to
3fdbbfe
Compare
I'm going to close this because it still needs some work and hasn't seen any activity recently. @Ape thanks for the effort! |
Resolves #1137.