mirror of
https://github.com/BepInEx/BepInEx.git
synced 2026-10-19 15:51:45 +00:00
Fix misleading error label for Finished handlers (#1329)
BaseChainloader.Execute invoked the Finished event inside the same try/catch that reports plugin-loading failures, so an exception thrown by a Finished event listener was logged as "Error occurred loading plugins:" even though it was unrelated to plugin loading. Move Finished?.Invoke() into its own try/catch with an accurate message. Control flow is otherwise unchanged: Finished still runs only after LoadPlugins succeeds, a throwing listener is still caught, and "Chainloader startup complete" is still logged afterwards. Fixes #842
This commit is contained in:
1 parent
77d438cf69
commit
f568f0e7b5
1 file changed
+9
-1
@@ -315,7 +315,15 @@ public abstract class BaseChainloader<TPlugin>
|
||||
var plugins = DiscoverPlugins();
|
||||
Logger.Log(LogLevel.Info, $"{plugins.Count} plugin{(plugins.Count == 1 ? "" : "s")} to load");
|
||||
LoadPlugins(plugins);
|
||||
Finished?.Invoke();
|
||||
|
||||
try
|
||||
{
|
||||
Finished?.Invoke();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Logger.Log(LogLevel.Error, $"Error occurred in a Chainloader.Finished event handler: {ex}");
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user