mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Merge pull request #257 from Flow-Launcher/fix_error_capturing
Fix error handling in PluginsManager and plugins query, fixed postbuild script duplicate deletion during build
This commit is contained in:
commit
3d9cd13bd6
4 changed files with 27 additions and 10 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 the plugin {plugin.Metadata.Name}", e, "QueryResults");
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
@ -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 plugins", t.Exception?.InnerException, "QueryResults");
|
||||
}, TaskContinuationOptions.OnlyOnFaulted);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:system="clr-namespace:System;assembly=mscorlib">
|
||||
|
||||
|
|
@ -11,6 +11,8 @@
|
|||
<system:String x:Key="plugin_pluginsmanager_install_title">Plugin Install</system:String>
|
||||
<system:String x:Key="plugin_pluginsmanager_uninstall_title">Plugin Uninstall</system:String>
|
||||
<system:String x:Key="plugin_pluginsmanager_install_errormetadatafile">Install failed: unable to find the plugin.json metadata file from the new plugin</system:String>
|
||||
<system:String x:Key="plugin_pluginsmanager_install_error_title">Error installing plugin</system:String>
|
||||
<system:String x:Key="plugin_pluginsmanager_install_error_subtitle">Error occured while trying to install {0}</system:String>
|
||||
<system:String x:Key="plugin_pluginsmanager_update_noresult_title">No update available</system:String>
|
||||
<system:String x:Key="plugin_pluginsmanager_update_noresult_subtitle">All plugins are up to date</system:String>
|
||||
<system:String x:Key="plugin_pluginsmanager_update_prompt">{0} by {1} {2}{3}Would you like to update this plugin? After the update Flow will automatically restart.</system:String>
|
||||
|
|
|
|||
|
|
@ -131,16 +131,19 @@ namespace Flow.Launcher.Plugin.PluginsManager
|
|||
|
||||
Context.API.ShowMsg(Context.API.GetTranslation("plugin_pluginsmanager_downloading_plugin"),
|
||||
Context.API.GetTranslation("plugin_pluginsmanager_download_success"));
|
||||
|
||||
Install(plugin, filePath);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Context.API.ShowMsg(Context.API.GetTranslation("plugin_pluginsmanager_downloading_plugin"),
|
||||
Context.API.GetTranslation("plugin_pluginsmanager_download_success"));
|
||||
Context.API.ShowMsg(Context.API.GetTranslation("plugin_pluginsmanager_install_error_title"),
|
||||
string.Format(Context.API.GetTranslation("plugin_pluginsmanager_install_error_subtitle"), plugin.Name));
|
||||
|
||||
Log.Exception("PluginsManager", "An error occured while downloading plugin", e, "PluginDownload");
|
||||
Log.Exception("PluginsManager", "An error occured while downloading plugin", e, "InstallOrUpdate");
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
Install(plugin, filePath);
|
||||
Context.API.RestartApp();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -44,8 +44,9 @@ function Delete-Unused ($path, $config) {
|
|||
$target = "$path\Output\$config"
|
||||
$included = Get-ChildItem $target -Filter "*.dll"
|
||||
foreach ($i in $included){
|
||||
Remove-Item -Path $target\Plugins -Include $i -Recurse
|
||||
Write-Host "Deleting duplicated $i"
|
||||
$deleteList = Get-ChildItem $target\Plugins -Include $i -Recurse | Where { $_.VersionInfo.FileVersion -eq $i.VersionInfo.FileVersion -And $_.Name -eq "$i" }
|
||||
$deleteList | ForEach-Object{ Write-Host Deleting duplicated $_.Name with version $_.VersionInfo.FileVersion at location $_.Directory.FullName }
|
||||
$deleteList | Remove-Item
|
||||
}
|
||||
Remove-Item -Path $target -Include "*.xml" -Recurse
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue