Skip to content

Commit aa0ee75

Browse files
authored
Merge pull request #270 from taooceros/PluginUpdateErrorHandling
Error handling for plugin update
2 parents d60b873 + 6287358 commit aa0ee75

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

Plugins/Flow.Launcher.Plugin.PluginsManager/PluginsManager.cs

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,11 +214,23 @@ on existingPlugin.Metadata.ID equals pluginFromManifest.ID
214214

215215
Task.Run(async delegate
216216
{
217+
Context.API.ShowMsg(Context.API.GetTranslation("plugin_pluginsmanager_downloading_plugin"),
218+
Context.API.GetTranslation("plugin_pluginsmanager_please_wait"));
219+
217220
await Http.Download(x.PluginNewUserPlugin.UrlDownload, downloadToFilePath).ConfigureAwait(false);
221+
222+
Context.API.ShowMsg(Context.API.GetTranslation("plugin_pluginsmanager_downloading_plugin"),
223+
Context.API.GetTranslation("plugin_pluginsmanager_download_success"));
224+
218225
Install(x.PluginNewUserPlugin, downloadToFilePath);
219226

220227
Context.API.RestartApp();
221-
});
228+
}).ContinueWith(t =>
229+
{
230+
Log.Exception("PluginsManager", $"Update failed for {x.Name}", t.Exception.InnerException, "RequestUpdate");
231+
Context.API.ShowMsg(Context.API.GetTranslation("plugin_pluginsmanager_install_error_title"),
232+
string.Format(Context.API.GetTranslation("plugin_pluginsmanager_install_error_subtitle"), x.Name));
233+
}, TaskContinuationOptions.OnlyOnFaulted);
222234

223235
return true;
224236
}

Plugins/Flow.Launcher.Plugin.PluginsManager/plugin.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"Name": "Plugins Manager",
77
"Description": "Management of installing, uninstalling or updating Flow Launcher plugins",
88
"Author": "Jeremy Wu",
9-
"Version": "1.4.0",
9+
"Version": "1.4.1",
1010
"Language": "csharp",
1111
"Website": "https://github.com/Flow-Launcher/Flow.Launcher",
1212
"ExecuteFileName": "Flow.Launcher.Plugin.PluginsManager.dll",

0 commit comments

Comments
 (0)