Jump to content

[LU-349444] Built in Mod DLL Loader silences exceptions


AntiBlueQuirk
  • Branch: Preview Branch Version: Windows Pending

As part of loading subscribed mods, the built in mod loader calls KMod.DLLLoader.LoadDLLs(path). This function is responsible for finding all of the .dll files in the mod directory, searching their types for OnLoad methods and such, and actually applying the Harmony patches from the mod. If an exception is thrown anywhere in this process, the function remembers indicating failure, and as for the exception... it does nothing. It just swallows the exception. The function indicates failure, so "Failed to load mod ZZZ...disabling" appears in the log, but the exception just disappears, along with all its valuable debugging information.

For mod development, this is really not ideal, since if one of your patches is crashing somewhere, there's no way to actually tell what is happening, since the debug information is swallowed by the mod loader. I think the mod loader needs to print the exception to the log, if nothing else.


Steps to Reproduce
1. Create a mod that throws an exception in its PrePatch, PostPatch, or OnLoad methods, or in one of its Harmony patches. 2. Attempt to load the mod by putting it in `\Klei\OxygenNotIncluded\mods\dev\ModName\` 3. Note that the game notices the mod crashing and requires a restart. 4. Note that `output_log.txt` contains no mention of the exception.



User Feedback


There are no comments to display.



Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
  • Create New...