diff --git a/src/modules/launcher/Plugins/Microsoft.Plugin.Program/Storage/Win32ProgramFileSystemWatchers.cs b/src/modules/launcher/Plugins/Microsoft.Plugin.Program/Storage/Win32ProgramFileSystemWatchers.cs index e20e890037..990f0c94e6 100644 --- a/src/modules/launcher/Plugins/Microsoft.Plugin.Program/Storage/Win32ProgramFileSystemWatchers.cs +++ b/src/modules/launcher/Plugins/Microsoft.Plugin.Program/Storage/Win32ProgramFileSystemWatchers.cs @@ -40,9 +40,15 @@ namespace Microsoft.Plugin.Program.Storage var invalidPaths = new List(); foreach (var path in paths) { - if (!Directory.Exists(path)) + try { - Log.Warn($"Directory {path} does not exist and will be ignored", typeof(Win32ProgramFileSystemWatchers)); + Directory.GetFiles(path); + } +#pragma warning disable CA1031 // Do not catch general exception types + catch (Exception ex) +#pragma warning restore CA1031 // Do not catch general exception types + { + Log.Exception($"Failed to get files in {path}", ex, typeof(Win32ProgramFileSystemWatchers)); invalidPaths.Add(path); } }