This repository was archived by the owner on Dec 5, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -12,22 +12,24 @@ public static class CopyHelper
12
12
13
13
public static void Copy ( NPath fromPath , NPath toPath )
14
14
{
15
+ Logger . Trace ( "Error copying from " + fromPath + " to " + toPath + "." ) ;
16
+
15
17
try
16
18
{
17
19
18
20
CopyFolder ( fromPath , toPath ) ;
19
21
}
20
22
catch ( Exception ex1 )
21
23
{
22
- Logger . Warning ( ex1 , "Error copying from " + fromPath + " to " + toPath + ". Attempting to copy contents .") ;
24
+ Logger . Warning ( ex1 , "Error copying." ) ;
23
25
24
26
try
25
27
{
26
28
CopyFolderContents ( fromPath , toPath ) ;
27
29
}
28
30
catch ( Exception ex2 )
29
31
{
30
- Logger . Error ( ex2 , "Error copying from " + fromPath + " to " + toPath + " .") ;
32
+ Logger . Error ( ex1 , "Error copying contents ." ) ;
31
33
throw ;
32
34
}
33
35
}
@@ -39,7 +41,7 @@ public static void Copy(NPath fromPath, NPath toPath)
39
41
public static void CopyFolder ( NPath fromPath , NPath toPath )
40
42
{
41
43
Logger . Trace ( "CopyFolder fromPath: {0} toPath:{1}" , fromPath . ToString ( ) , toPath . ToString ( ) ) ;
42
-
44
+ toPath . DeleteIfExists ( ) ;
43
45
toPath . EnsureParentDirectoryExists ( ) ;
44
46
fromPath . Move ( toPath ) ;
45
47
}
You can’t perform that action at this time.
0 commit comments