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
1212
1313 public static void Copy ( NPath fromPath , NPath toPath )
1414 {
15+ Logger . Trace ( "Error copying from " + fromPath + " to " + toPath + "." ) ;
16+
1517 try
1618 {
1719
1820 CopyFolder ( fromPath , toPath ) ;
1921 }
2022 catch ( Exception ex1 )
2123 {
22- Logger . Warning ( ex1 , "Error copying from " + fromPath + " to " + toPath + ". Attempting to copy contents .") ;
24+ Logger . Warning ( ex1 , "Error copying." ) ;
2325
2426 try
2527 {
2628 CopyFolderContents ( fromPath , toPath ) ;
2729 }
2830 catch ( Exception ex2 )
2931 {
30- Logger . Error ( ex2 , "Error copying from " + fromPath + " to " + toPath + " .") ;
32+ Logger . Error ( ex1 , "Error copying contents ." ) ;
3133 throw ;
3234 }
3335 }
@@ -39,7 +41,7 @@ public static void Copy(NPath fromPath, NPath toPath)
3941 public static void CopyFolder ( NPath fromPath , NPath toPath )
4042 {
4143 Logger . Trace ( "CopyFolder fromPath: {0} toPath:{1}" , fromPath . ToString ( ) , toPath . ToString ( ) ) ;
42-
44+ toPath . DeleteIfExists ( ) ;
4345 toPath . EnsureParentDirectoryExists ( ) ;
4446 fromPath . Move ( toPath ) ;
4547 }
You can’t perform that action at this time.
0 commit comments