-
Notifications
You must be signed in to change notification settings - Fork 28
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] Map Windows errors #96
Comments
Thanks for the suggestion, I am definitely open to making the error type more useful on Windows as well. |
I'll try to do similarly for the finder method in macos, too (ref). |
I'm thinking it would be useful to have an ability to pass on error codes for otherwise unhandled errors. I see two ways to do this:
Thoughts on which is preferred? |
Since any change to I'd also recommend to go with your intuition if anything changes during implementation, the only tries to optimize for being 'least breaking' or 'easily fixable' if it breaks. |
For macOS the code returned by We could use a regex to parse the error, but this seems like a task better left for the end user. |
Thanks for sharing!
I agree, a viable step would be to improve the documentation here. Adding a regex dependency seems out of the question except for when it's behind a feature gate. |
It appears that all
windows::core::Error
's are mapped totrash::Error::Unknown
(code here). Is it possible to use the error code (ref) to map at least some of the more common errors to the correspondingtrash::Error
variant?e.g. codes 2 and 3 could map to trash::Error::FileSystem with an error kind of
std::io::ErrorKind::NotFound
.Another option could allow for the
Unknown
variant to also accept an optional error code, but that doesn't feel like the correct way to go about it.Happy to give implementation a shot if it seems like a good idea.
The text was updated successfully, but these errors were encountered: