Plugins: Pass PluginEventInfo instead of PluginErrorEventArgs to ErrorHandler

This commit is contained in:
Katy Coe
2020-12-24 00:12:55 +01:00
parent 2e7187795a
commit 61d86d7d96
5 changed files with 16 additions and 7 deletions

View File

@@ -15,6 +15,7 @@ using System.Windows;
using System.Windows.Markup;
using Il2CppInspector;
using Il2CppInspector.Model;
using Il2CppInspector.PluginAPI.V100;
using Il2CppInspector.Reflection;
using Inspector = Il2CppInspector.Il2CppInspector;
@@ -83,7 +84,10 @@ namespace Il2CppInspectorGUI
// Set handlers for plugin manager
PluginManager.ErrorHandler += (s, e) => {
MessageBox.Show($"The plugin {e.Plugin.Name} encountered an error while executing {e.Operation}: {e.Exception.Message}."
if (e is PluginOptionsChangedEventInfo)
MessageBox.Show("Could not update plugin options. " + e.Error.Exception.Message, "Plugin error");
else
MessageBox.Show($"The plugin {e.Error.Plugin.Name} encountered an error while executing {e.Error.Operation}: {e.Error.Exception.Message}."
+ Environment.NewLine + Environment.NewLine + "The application will continue but may not behave as expected.", "Plugin error");
};