Skip to content
This repository was archived by the owner on Dec 5, 2024. It is now read-only.

Commit 0563f00

Browse files
Fixing CopyHelper error
1 parent 1c53148 commit 0563f00

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/GitHub.Api/Installer/CopyHelper.cs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff 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
}

0 commit comments

Comments
 (0)