From 9058afd1b0f381dcb7452f9fd0aab1feebdcf1b7 Mon Sep 17 00:00:00 2001 From: Jeremy Wu Date: Fri, 22 May 2020 06:48:03 +1000 Subject: [PATCH] Update error messages --- Flow.Launcher.Core/Plugin/PluginsLoader.cs | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/Flow.Launcher.Core/Plugin/PluginsLoader.cs b/Flow.Launcher.Core/Plugin/PluginsLoader.cs index 51fa5bc9b..afbc18fdb 100644 --- a/Flow.Launcher.Core/Plugin/PluginsLoader.cs +++ b/Flow.Launcher.Core/Plugin/PluginsLoader.cs @@ -55,7 +55,7 @@ namespace Flow.Launcher.Core.Plugin { erroredPlugins.Add(metadata.Name); - Log.Exception($"|PluginsLoader.DotNetPlugins|Couldn't load assembly for {metadata.Name}", e); + Log.Exception($"|PluginsLoader.DotNetPlugins|Couldn't load assembly for the plugin: {metadata.Name}", e); return; } @@ -70,14 +70,14 @@ namespace Flow.Launcher.Core.Plugin { erroredPlugins.Add(metadata.Name); - Log.Exception($"|PluginsLoader.DotNetPlugins|Can't find class implement IPlugin for <{metadata.Name}>", e); + Log.Exception($"|PluginsLoader.DotNetPlugins|Can't find the required IPlugin interface for the plugin: <{metadata.Name}>", e); return; } catch (ReflectionTypeLoadException e) { erroredPlugins.Add(metadata.Name); - Log.Exception($"|PluginsLoader.DotNetPlugins|The GetTypes method was unable to load assembly types for <{metadata.Name}>", e); + Log.Exception($"|PluginsLoader.DotNetPlugins|The GetTypes method was unable to load assembly types for the plugin: <{metadata.Name}>", e); return; } @@ -90,7 +90,7 @@ namespace Flow.Launcher.Core.Plugin { erroredPlugins.Add(metadata.Name); - Log.Exception($"|PluginsLoader.DotNetPlugins|Can't create instance for <{metadata.Name}>", e); + Log.Exception($"|PluginsLoader.DotNetPlugins|The following plugin has errored and can not be loaded: <{metadata.Name}>", e); return; } #endif @@ -109,11 +109,15 @@ namespace Flow.Launcher.Core.Plugin { var errorPluginString = ""; + var errorMessage = "The following " + + (erroredPlugins.Count > 1 ? "plugins have " : "plugin has ") + + "errored and cannot be loaded:"; + erroredPlugins.ForEach(x => errorPluginString += x + Environment.NewLine); Task.Run(() => { - MessageBox.Show($"Uh oh, unable to load plugins:{Environment.NewLine}{errorPluginString}"); + MessageBox.Show($"{errorMessage}{Environment.NewLine}{errorPluginString}"); }); }