Skip to content

Commit

Permalink
#353: add path information to some more windows errors
Browse files Browse the repository at this point in the history
  • Loading branch information
passcod authored and 0xpr03 committed Aug 22, 2021
1 parent 8360a20 commit 23f54f6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/windows.rs
Expand Up @@ -147,7 +147,7 @@ impl ReadDirectoryChangesServer {
if !path.is_dir() && !path.is_file() {
return Err(Error::generic(
"Input watch path is neither a file nor a directory.",
));
).add_path(path));
}

let (watching_file, dir_target) = {
Expand Down Expand Up @@ -181,7 +181,7 @@ impl ReadDirectoryChangesServer {
Error::generic(
"You attempted to watch a single file, but parent \
directory could not be opened.",
)
).add_path(path)
} else {
// TODO: Call GetLastError for better error info?
Error::path_not_found().add_path(path)
Expand All @@ -200,7 +200,7 @@ impl ReadDirectoryChangesServer {
unsafe {
handleapi::CloseHandle(handle);
}
return Err(Error::generic("Failed to create semaphore for watch."));
return Err(Error::generic("Failed to create semaphore for watch.").add_path(path));
}
let rd = ReadData {
dir: dir_target,
Expand Down

0 comments on commit 23f54f6

Please sign in to comment.