Optimize exception message logic

This commit is contained in:
弘韬 张 2021-01-29 12:17:17 +08:00
parent 89453f441d
commit 2271ec16fd
2 changed files with 7 additions and 12 deletions

View file

@ -71,17 +71,8 @@ namespace Flow.Launcher.Plugin.PluginsManager
{
_ = pluginManager.UpdateManifest().ContinueWith(t =>
{
if (t.IsCompletedSuccessfully)
{
lastUpdateTime = DateTime.Now;
}
else
{
Context.API.ShowMsg("Plugin Manifest Download Fail.",
"Please check if you can connect to github.com. " +
"This error means you may not be able to Install and Update Plugin.", pluginManager.icoPath, false);
}
});
lastUpdateTime = DateTime.Now;
}, TaskContinuationOptions.OnlyOnRanToCompletion);
}
return search switch

View file

@ -48,7 +48,11 @@ namespace Flow.Launcher.Plugin.PluginsManager
internal Task UpdateManifest()
{
return _downloadManifestTask = pluginsManifest.DownloadManifest();
return _downloadManifestTask = pluginsManifest.DownloadManifest().ContinueWith(t =>
Context.API.ShowMsg("Plugin Manifest Download Fail.",
"Please check if you can connect to github.com. " +
"This error means you may not be able to Install and Update Plugin.", icoPath, false),
TaskContinuationOptions.OnlyOnFaulted);
}
internal List<Result> GetDefaultHotKeys()