mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Add Exception Handling for Querying plugins results
This commit is contained in:
parent
29a382085f
commit
f1badd6ae2
1 changed files with 14 additions and 3 deletions
|
|
@ -21,6 +21,7 @@ using Flow.Launcher.Plugin.SharedCommands;
|
|||
using Flow.Launcher.Storage;
|
||||
using System.Windows.Media;
|
||||
using Flow.Launcher.Infrastructure.Image;
|
||||
using Flow.Launcher.Infrastructure.Logger;
|
||||
|
||||
namespace Flow.Launcher.ViewModel
|
||||
{
|
||||
|
|
@ -414,8 +415,15 @@ namespace Flow.Launcher.ViewModel
|
|||
{
|
||||
if (!plugin.Metadata.Disabled)
|
||||
{
|
||||
var results = PluginManager.QueryForPlugin(plugin, query);
|
||||
UpdateResultView(results, plugin.Metadata, query);
|
||||
try
|
||||
{
|
||||
var results = PluginManager.QueryForPlugin(plugin, query);
|
||||
UpdateResultView(results, plugin.Metadata, query);
|
||||
}
|
||||
catch(Exception e)
|
||||
{
|
||||
Log.Exception($"|MainViewModel|Exception when querying {plugin.Metadata.Name}", e);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
@ -432,7 +440,10 @@ namespace Flow.Launcher.ViewModel
|
|||
{ // update to hidden if this is still the current query
|
||||
ProgressBarVisibility = Visibility.Hidden;
|
||||
}
|
||||
}, currentCancellationToken);
|
||||
}, currentCancellationToken).ContinueWith(t =>
|
||||
{
|
||||
Log.Exception("|MainViewModel|Error when querying plugin", t.Exception?.InnerException);
|
||||
}, TaskContinuationOptions.OnlyOnFaulted);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
|
|
|||
Loading…
Reference in a new issue