1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2024-12-14 11:23:42 +02:00

Fixed: Error handling when cannot create folder in Recycling Bin

Closes #4163
This commit is contained in:
Robin Dadswell 2021-01-17 18:27:58 +00:00 committed by GitHub
parent ab478fd64b
commit c05fccb90d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -93,7 +93,16 @@ public void DeleteFile(string path, string subfolder = "")
var destinationFolder = Path.Combine(recyclingBin, subfolder);
var destination = Path.Combine(destinationFolder, fileInfo.Name);
_diskProvider.CreateFolder(destinationFolder);
try
{
_logger.Debug("Creating folder [0]", destinationFolder);
_diskProvider.CreateFolder(destinationFolder);
}
catch (IOException e)
{
_logger.Error(e, "Unable to create the folder '{0}' in the recycling bin for the file '{1}'", destinationFolder, fileInfo.Name);
throw;
}
var index = 1;
while (_diskProvider.FileExists(destination))