From 6cf98d49300459b7795b994733ba05837e22cf1e Mon Sep 17 00:00:00 2001 From: Tim Eisele Date: Fri, 21 Jun 2024 17:08:05 +0200 Subject: [PATCH] Only cleanup children on specific exceptions (#12134) --- MediaBrowser.Controller/Entities/Folder.cs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/MediaBrowser.Controller/Entities/Folder.cs b/MediaBrowser.Controller/Entities/Folder.cs index fcb45e7e5..b2e5d7263 100644 --- a/MediaBrowser.Controller/Entities/Folder.cs +++ b/MediaBrowser.Controller/Entities/Folder.cs @@ -6,6 +6,7 @@ using System; using System.Collections.Generic; using System.IO; using System.Linq; +using System.Security; using System.Text.Json.Serialization; using System.Threading; using System.Threading.Tasks; @@ -370,9 +371,18 @@ namespace MediaBrowser.Controller.Entities { nonCachedChildren = GetNonCachedChildren(directoryService); } + catch (IOException ex) + { + Logger.LogError(ex, "Error retrieving children from file system"); + } + catch (SecurityException ex) + { + Logger.LogError(ex, "Error retrieving children from file system"); + } catch (Exception ex) { - Logger.LogError(ex, "Error retrieving children folder"); + Logger.LogError(ex, "Error retrieving children"); + return; } progress.Report(ProgressHelpers.RetrievedChildren);