Skip to content

Commit

Permalink
Handle Error when deleting the directory (#8635)
Browse files Browse the repository at this point in the history
  • Loading branch information
chidozieononiwu authored Jul 15, 2024
1 parent db97d69 commit 9452e04
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/dotnet/APIView/APIViewWeb/Languages/LanguageProcessor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,15 @@ public override async Task<CodeFile> GetCodeFileAsync(string originalName, Strea
}
finally
{
Directory.Delete(tempDirectory, true);
await Task.Delay(1000);
try
{
Directory.Delete(tempDirectory, true);
}
catch (Exception ex)
{
Console.WriteLine($"Failed to delete directory: {ex.Message}");
}
}
}
}
Expand Down

0 comments on commit 9452e04

Please sign in to comment.