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

@@ -113,7 +113,7 @@ namespace Il2CppInspector
// Error handler called when a plugin throws an exception
// This should be hooked by the client consuming the Il2CppInspector class library
// If not used, all exceptions are suppressed (which is probably really bad)
public static event EventHandler<PluginErrorEventArgs> ErrorHandler;
public static event EventHandler<PluginEventInfo> ErrorHandler;
// Handler called when a plugin reports a status update
// If not used, all status updates are suppressed
@@ -232,7 +232,7 @@ namespace Il2CppInspector
}
catch (Exception ex) {
eventInfo.Error = new PluginErrorEventArgs { Plugin = plugin, Exception = ex, Operation = "options update" };
ErrorHandler?.Invoke(AsInstance, eventInfo.Error);
ErrorHandler?.Invoke(AsInstance, eventInfo);
}
return eventInfo;
@@ -254,7 +254,7 @@ namespace Il2CppInspector
}
catch (Exception ex) {
eventInfo.Error = new PluginErrorEventArgs { Plugin = plugin, Exception = ex, Operation = typeof(I).Name };
ErrorHandler?.Invoke(AsInstance, eventInfo.Error);
ErrorHandler?.Invoke(AsInstance, eventInfo);
}
return eventInfo;