ChrisNeedham24 / microcosm

A little 4X game written using Pyxel.
GNU General Public License v3.0
11 stars 8 forks source link

Handle cases where loaded save files are no longer valid #94 #102

Closed langstof825 closed 1 year ago

langstof825 commented 1 year ago

Ready for review. Added new popup for when loading a save file fails. Added exception handling for load_game function. Created MCR-103 for the backwards compatibility stuff.

langstof825 commented 1 year ago

The linter seems to be failing as I am catching the general Exception. Is there a way to disable the lint for that specific try/except?

ChrisNeedham24 commented 1 year ago

Well ideally we could have the catch as except (AttributeError, OtherException): but if you're not 100% on which different exceptions can be thrown, you should be able to chuck # pylint: disable=broad-except above the except.

langstof825 commented 1 year ago

Yeah I wasn't 100% sure apart from AttributeError.