Skip to content

Commit a276022

Browse files
committed
fix error logging message
1 parent cc283fd commit a276022

File tree

2 files changed

+14
-5
lines changed

2 files changed

+14
-5
lines changed

Plugins/Flow.Launcher.Plugin.Explorer/Languages/en.xaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
<system:String x:Key="plugin_explorer_windowsSearchServiceFix">To fix this, start the Windows Search service. Select here to remove this warning</system:String>
1616
<system:String x:Key="plugin_explorer_alternative">The warning message has been switched off. As an alternative for searching files and folders, would you like to install Everything plugin?{0}{0}Select 'Yes' to install Everything plugin, or 'No' to return</system:String>
1717
<system:String x:Key="plugin_explorer_alternative_title">Explorer Alternative</system:String>
18+
<system:String x:Key="plugin_explorer_directoryinfosearch_error">Error occurred during search: {0}</system:String>
1819

1920
<!--Controls-->
2021
<system:String x:Key="plugin_explorer_delete">Delete</system:String>

Plugins/Flow.Launcher.Plugin.Explorer/Search/DirectoryInfo/DirectoryInfoSearch.cs

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using Flow.Launcher.Infrastructure.Logger;
1+
using Flow.Launcher.Infrastructure.Logger;
22
using Flow.Launcher.Plugin.SharedCommands;
33
using System;
44
using System.Collections.Generic;
@@ -58,8 +58,7 @@ private static List<Result> DirectorySearch(EnumerationOptions enumerationOption
5858
{
5959
var directoryInfo = new System.IO.DirectoryInfo(path);
6060

61-
foreach (var fileSystemInfo in directoryInfo.EnumerateFileSystemInfos(searchCriteria, enumerationOption)
62-
)
61+
foreach (var fileSystemInfo in directoryInfo.EnumerateFileSystemInfos(searchCriteria, enumerationOption))
6362
{
6463
if (fileSystemInfo is System.IO.DirectoryInfo)
6564
{
@@ -76,8 +75,17 @@ private static List<Result> DirectorySearch(EnumerationOptions enumerationOption
7675
}
7776
catch (Exception e)
7877
{
79-
Log.Exception("Flow.Plugin.Explorer.", nameof(DirectoryInfoSearch), e);
80-
results.Add(new Result {Title = e.Message, Score = 501});
78+
Log.Exception(nameof(DirectoryInfoSearch), "Error occured while searching path", e);
79+
80+
results.Add(
81+
new Result
82+
{
83+
Title = string.Format(SearchManager.Context.API.GetTranslation(
84+
"plugin_explorer_directoryinfosearch_error"),
85+
e.Message),
86+
Score = 501,
87+
IcoPath = Constants.ExplorerIconImagePath
88+
});
8189

8290
return results;
8391
}

0 commit comments

Comments
 (0)