From 23f54f65669774ed7d712b4229f98b6cca48b8d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fe=CC=81lix=20Saparelli?= Date: Mon, 23 Aug 2021 05:11:02 +1200 Subject: [PATCH] #353: add path information to some more windows errors --- src/windows.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/windows.rs b/src/windows.rs index d38cb026..03ea0805 100644 --- a/src/windows.rs +++ b/src/windows.rs @@ -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) = { @@ -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) @@ -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,