mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-07 11:46:30 +02:00
skip broken folder when re-index (#2004)
* skip broken folder when re-index * add log for DirectoryNotFoundException
This commit is contained in:
@@ -216,7 +216,15 @@ namespace Wox.Plugin.Program.Programs
|
|||||||
{
|
{
|
||||||
foreach (var suffix in suffixes)
|
foreach (var suffix in suffixes)
|
||||||
{
|
{
|
||||||
files.AddRange(Directory.EnumerateFiles(currentDirectory, $"*.{suffix}", SearchOption.TopDirectoryOnly));
|
try
|
||||||
|
{
|
||||||
|
files.AddRange(Directory.EnumerateFiles(currentDirectory, $"*.{suffix}", SearchOption.TopDirectoryOnly));
|
||||||
|
}
|
||||||
|
catch (DirectoryNotFoundException e)
|
||||||
|
{
|
||||||
|
Log.Exception($"|Program.Win32.ProgramPaths|skip directory(<{currentDirectory}>)", e);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception e) when (e is SecurityException || e is UnauthorizedAccessException)
|
catch (Exception e) when (e is SecurityException || e is UnauthorizedAccessException)
|
||||||
|
|||||||
Reference in New Issue
Block a user