It appears that all windows::core::Error's are mapped to trash::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 corresponding trash::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.
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::Errorvariant?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
Unknownvariant 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.