From 9eafb8fe8c45fdfc0f525744254f1da77574dce6 Mon Sep 17 00:00:00 2001 From: Robin Dadswell Date: Sun, 17 Jan 2021 18:27:58 +0000 Subject: [PATCH] Fixed: Error handling when cannot create folder in Recycling Bin (cherry picked from commit c05fccb90d64d92836603b55d4bd30d5cbdb96a5) --- src/NzbDrone.Core/MediaFiles/RecycleBinProvider.cs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/NzbDrone.Core/MediaFiles/RecycleBinProvider.cs b/src/NzbDrone.Core/MediaFiles/RecycleBinProvider.cs index a34933565..4cb0a44c7 100644 --- a/src/NzbDrone.Core/MediaFiles/RecycleBinProvider.cs +++ b/src/NzbDrone.Core/MediaFiles/RecycleBinProvider.cs @@ -88,7 +88,16 @@ namespace NzbDrone.Core.MediaFiles 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))