Make events more robust
Pathoschild opened this issue ยท 1 comments
There are two issues with the way SMAPI raises events:
- An exception thrown by some event handlers immediately crashes the game with no error in the log.
Many events have no error-handling. This means exceptions bubble up into the game or XNA, which then crashes with no error in the log. This notably affectsGameEvents.GameLoaded
. - An exception thrown by any event handler prevents other mods from receiving the event.
An error in one mod's handler means every other mod won't be notified. For example, let's say ModA and ModB both subscribed toGameEvents.Initialize
; if ModA's handler throws an exception, ModB's handler will never be called.