Sorry, we don't support your browser.  Install a modern browser

Mod Exception Types#5318

Exception types made specifically for mods, specifically one for an exception thrown during mod loading.
Currently, mod developers are forced to crash the game outright as soon as their mod encounters an error. For simple mods (and even the more complex ones), it doesn’t make sense to do this. Instead, there needs to be an option to fail gracefully. That’s to say, a competent mod developer should have the ability to abort their mod loading if something doesn’t work.
For example, a simple mod that hooks a method using reflection will crash the game on startup if that method is renamed. Instead, it would be much less harmful to the user if instead of crashing the game, the mod would simply dispose of any hooks it already created and throw a ModInitialisationException. This would tell the game that an error occurred preventing the mod from initializing, but still allowing the rest of the game to load.
Even if the exception type didn’t prevent crashes, it would help users who encounter mod issues, especially if an exception was thrown inside a hooked method. It allows mod developers to say “Hey, I threw that exception. It was me.” You can do this with the existing exception constructor parameters, but a new ModException type would allow for much needed clarity when creating and using mods.

a month ago