mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-20 13:33:34 -07:00
Fixed: Error handling when cannot create folder in Recycling Bin
(cherry picked from commit c05fccb90d64d92836603b55d4bd30d5cbdb96a5)
This commit is contained in:
parent
0d7dbf8806
commit
9eafb8fe8c
1 changed files with 10 additions and 1 deletions
|
@ -88,7 +88,16 @@ namespace NzbDrone.Core.MediaFiles
|
||||||
var destinationFolder = Path.Combine(recyclingBin, subfolder);
|
var destinationFolder = Path.Combine(recyclingBin, subfolder);
|
||||||
var destination = Path.Combine(destinationFolder, fileInfo.Name);
|
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;
|
var index = 1;
|
||||||
while (_diskProvider.FileExists(destination))
|
while (_diskProvider.FileExists(destination))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue