Explorar o código

Only cleanup children on specific exceptions (#12134)

Tim Eisele hai 11 meses
pai
achega
6cf98d4930
Modificáronse 1 ficheiros con 11 adicións e 1 borrados
  1. 11 1
      MediaBrowser.Controller/Entities/Folder.cs

+ 11 - 1
MediaBrowser.Controller/Entities/Folder.cs

@@ -6,6 +6,7 @@ using System;
 using System.Collections.Generic;
 using System.Collections.Generic;
 using System.IO;
 using System.IO;
 using System.Linq;
 using System.Linq;
+using System.Security;
 using System.Text.Json.Serialization;
 using System.Text.Json.Serialization;
 using System.Threading;
 using System.Threading;
 using System.Threading.Tasks;
 using System.Threading.Tasks;
@@ -370,9 +371,18 @@ namespace MediaBrowser.Controller.Entities
                 {
                 {
                     nonCachedChildren = GetNonCachedChildren(directoryService);
                     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)
                 catch (Exception ex)
                 {
                 {
-                    Logger.LogError(ex, "Error retrieving children folder");
+                    Logger.LogError(ex, "Error retrieving children");
+                    return;
                 }
                 }
 
 
                 progress.Report(ProgressHelpers.RetrievedChildren);
                 progress.Report(ProgressHelpers.RetrievedChildren);