SaveLoadManager could use some try/catch blocks

Discuss coding questions, pull requests, and implementation details.
Post Reply
User avatar
DunnyOfPenwick
Posts: 275
Joined: Wed Apr 14, 2021 1:58 am
Location: Southeast US

SaveLoadManager could use some try/catch blocks

Post by DunnyOfPenwick »

I got a user bug report for my mod.
The mod save data had somehow got corrupted (filled with null values) and when they tried to load the game they were stuck looking at a black screen.

I think some try/catch blocks should be added to both Serialization and Deserialization calls in the SaveLoadManager.
At the very least the user should be informed there was a problem during save/load.
If it occurred for a particular mod they should be told which mod it was.

User avatar
Interkarma
Posts: 7236
Joined: Sun Mar 22, 2015 1:51 am

Re: SaveLoadManager could use some try/catch blocks

Post by Interkarma »

I've recently added exception handling when failing to load world variant data, which seems to be a common point of failure. I'll add something similar for mods, including an informational message for player about which mod's data failed to save/load.

Post Reply