Watch library directories with perm errors (#10684)

This commit is contained in:
Brian Howe 2024-09-19 08:12:32 -05:00 committed by GitHub
parent 9c4bf48b4e
commit 03aa37731b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

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