浏览代码

Watch library directories with perm errors (#10684)

Brian Howe 8 月之前
父节点
当前提交
03aa37731b
共有 1 个文件被更改,包括 6 次插入0 次删除
  1. 6 0
      Emby.Server.Implementations/IO/LibraryMonitor.cs

+ 6 - 0
Emby.Server.Implementations/IO/LibraryMonitor.cs

@@ -314,6 +314,12 @@ namespace Emby.Server.Implementations.IO
             var ex = e.GetException();
             var dw = (FileSystemWatcher)sender;
 
+            if (ex is UnauthorizedAccessException unauthorizedAccessException)
+            {
+                _logger.LogError(unauthorizedAccessException, "Permission error for Directory watcher: {Path}", dw.Path);
+                return;
+            }
+
             _logger.LogError(ex, "Error in Directory watcher for: {Path}", dw.Path);
 
             DisposeWatcher(dw, true);