Error catching?

Place to get help with not working mods / modding interface.
User avatar
Therenas
Factorio Staff
Factorio Staff
Posts: 326
Joined: Tue Dec 11, 2018 2:10 pm
Contact:

Error catching?

Post by Therenas »

I'm currently working on an all-GUI mod, and I would love it if any errors that it produces would not crash the save. For development, crashing is fine of course, but when other people use my mod, I would feel better if they wouldn't lose unsaved progess on their game because of some error on my part. So is it possible to catch those errors and prevent a save-crash? I would guess not, but if it does (or you know of any workaround), I would be grateful to know. Thanks!
User avatar
darkfrei
Smart Inserter
Smart Inserter
Posts: 2905
Joined: Thu Nov 20, 2014 11:11 pm
Contact:

Re: Error catching?

Post by darkfrei »

Rseding91
Factorio Staff
Factorio Staff
Posts: 16013
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: Error catching?

Post by Rseding91 »

You don't want to ever catch an error unless it's something outside of your control (parsing user input for example).

Catching errors in your logic just means you'll never hear about it being broken. If you have it crash-to-main-menu people are far more likely to tell you if they ever have an error and then you can fix it.

That's one of the core principles of Factorio development and why the game is as stable as it is: we don't silently swallow errors - we be as loud as possible so we always know when one happens and we can fix it.

Subsequently: there are very *very* few bugs left in the game. Anything we know about we fix.
If you want to get ahold of me I'm almost always on Discord.
User avatar
Therenas
Factorio Staff
Factorio Staff
Posts: 326
Joined: Tue Dec 11, 2018 2:10 pm
Contact:

Re: Error catching?

Post by Therenas »

Rseding91 wrote: Wed Jan 23, 2019 10:45 pm You don't want to ever catch an error unless it's something outside of your control (parsing user input for example).

Catching errors in your logic just means you'll never hear about it being broken. If you have it crash-to-main-menu people are far more likely to tell you if they ever have an error and then you can fix it.

That's one of the core principles of Factorio development and why the game is as stable as it is: we don't silently swallow errors - we be as loud as possible so we always know when one happens and we can fix it.

Subsequently: there are very *very* few bugs left in the game. Anything we know about we fix.
Hm I guess that is a sensible apporach, I haven't thought about it in that way. I was just a bit worried to destroy some users progress because my mod sucks, but I guess more testing will be the right solution in general. Thanks for the reply!
Post Reply

Return to “Modding help”