Only cleanup children on specific exceptions (#12134)

This commit is contained in:
Tim Eisele 2024-06-21 17:08:05 +02:00 committed by GitHub
parent 34a65980e3
commit 6cf98d4930
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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);