"Error occurred loading plugins:" text prepended to exceptions raised by listeners of the BaseChainloader.Finished event can be misleading #842
Labels
error
Error message or log that may need investigation
needs-replication
Issue needs to be replicated by BepInEx dev
What happened?
I'm working on a BepInEx plugin for Bleeding Edge 667 designed to provide helper functions for mod authors. However, this problem seems to still exist in the master branch (which is why I've marked it as applying to Stable).
After adding a listener to
BaseChainloader.Finished
, if the listener throws an exception during its execution afterBaseChainloader.Finished
is invoked, the exception message will be prepended with "Error occurred loading plugins:" even though the error is not necessarily related to plugin loading. This happens because the Invoke statement is in the try-catch block 1. It can be addressed by either taking the Invoke statement out of the block or by adding checks in the catch statement to ensure the problem is related to plugin loading instead of to an unrelated listener that happens to run after theFinished
event is invoked.You can find more context regarding the log output here: https://github.com/ReveredRedHood/SOD.Common_Fork/blob/feature/plugindetectionhelpers/SOD.Common/Helpers/PluginDetection.cs#L60.
BepInEx Distribution
Stable from GitHub
Log outputs
Environment
Footnotes
https://github.com/BepInEx/BepInEx/blob/49015217f3becf052d33fa4658ac19229f5daa3a/BepInEx.Core/Bootstrap/BaseChainloader.cs#L318 ↩
The text was updated successfully, but these errors were encountered: