Skip to content

Commit 08da4e3

Browse files
Use toast to improve consistency
1 parent 0870c5a commit 08da4e3

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

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

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -148,19 +148,19 @@ internal async Task InstallOrUpdateAsync(UserPlugin plugin)
148148

149149
Install(plugin, filePath);
150150
}
151+
catch (HttpRequestException e)
152+
{
153+
Context.API.ShowMsgError(string.Format(Context.API.GetTranslation("plugin_pluginsmanager_downloading_plugin"), plugin.Name),
154+
Context.API.GetTranslation("plugin_pluginsmanager_download_error"));
155+
Log.Exception("PluginsManager", "An error occurred while downloading plugin", e);
156+
return;
157+
}
151158
catch (Exception e)
152159
{
153-
// TODO use toast to optimize error prompt
154-
if (e is HttpRequestException)
155-
MessageBox.Show(Context.API.GetTranslation("plugin_pluginsmanager_download_error"),
156-
Context.API.GetTranslation("plugin_pluginsmanager_downloading_plugin"));
157-
158160
Context.API.ShowMsgError(Context.API.GetTranslation("plugin_pluginsmanager_install_error_title"),
159161
string.Format(Context.API.GetTranslation("plugin_pluginsmanager_install_error_subtitle"),
160162
plugin.Name));
161-
162-
Log.Exception("PluginsManager", "An error occurred while downloading plugin", e, "InstallOrUpdate");
163-
163+
Log.Exception("PluginsManager", "An error occurred while downloading plugin", e);
164164
return;
165165
}
166166

0 commit comments

Comments
 (0)