From fae18b28d001cefeb1355667f5314fea835b2232 Mon Sep 17 00:00:00 2001 From: Simon Cropp Date: Fri, 13 May 2022 16:17:18 +1000 Subject: [PATCH] better error handling when accepting or discarding files --- src/DiffEngineTray/FileEx.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/DiffEngineTray/FileEx.cs b/src/DiffEngineTray/FileEx.cs index 7e845c14..84c7f3e0 100644 --- a/src/DiffEngineTray/FileEx.cs +++ b/src/DiffEngineTray/FileEx.cs @@ -19,6 +19,10 @@ public static void SafeDelete(string path) //Swallow this since it is likely that a running test it reading or //writing to the files, and the result will re-add the tracked item } + catch (Exception exception) + { + ExceptionHandler.Handle($"Filed to delete '{path}'.", exception); + } } public static void SafeMove(string temp, string target) @@ -38,5 +42,9 @@ public static void SafeMove(string temp, string target) //Swallow this since it is likely that a running test it reading or //writing to the files, and the result will re-add the tracked item } + catch (Exception exception) + { + ExceptionHandler.Handle($"Filed to move '{temp}' to '{target}'.", exception); + } } } \ No newline at end of file