Skip to content
This repository was archived by the owner on Jun 27, 2019. It is now read-only.

Commit 10cd31e

Browse files
committed
Swallow UnauthorizedAccessException too
1 parent 20295a2 commit 10cd31e

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/GitTools.Core/GitTools.Core.Shared/IO/Helpers/DeleteHelper.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
namespace GitTools.IO
22
{
3+
using System;
34
using System.IO;
45

56
public static class DeleteHelper
@@ -26,6 +27,9 @@ public static void DeleteGitRepository(string directory)
2627
}
2728
catch (FileNotFoundException)
2829
{
30+
}
31+
catch (UnauthorizedAccessException)
32+
{
2933
}
3034
}
3135

@@ -34,6 +38,9 @@ public static void DeleteGitRepository(string directory)
3438
catch (DirectoryNotFoundException)
3539
{
3640
}
41+
catch (UnauthorizedAccessException)
42+
{
43+
}
3744
}
3845

3946

@@ -46,6 +53,9 @@ public static void DeleteDirectory(string directory, bool recursive)
4653
catch (DirectoryNotFoundException)
4754
{
4855
}
56+
catch (UnauthorizedAccessException)
57+
{
58+
}
4959
}
5060
}
5161
}

0 commit comments

Comments
 (0)