Providing a useful message for startup errors
Posted: Mon Nov 20, 2017 10:02 pm
I recall once when I installed a mod and tried to launch Factorio I got an error from that mod during startup (the data*.lua phases) from that mod along the lines of "I noticed you have this other incompatible mod installed; you shouldn't use us both at the same time".
That was very helpful. Now I find myself wanting to do the same with a mod of my own -- that is, provide a useful error message when I detect a fatal configuration issue during startup, and thus pre-empt a load failure with a less useful error that would otherwise occur.
Unfortunately I can't remember in which mod I originally saw this feature, and I can't find anything that would achieve this in the documentation (it's entirely possible I just missed it). Can anyone suggest how to do it?
That was very helpful. Now I find myself wanting to do the same with a mod of my own -- that is, provide a useful error message when I detect a fatal configuration issue during startup, and thus pre-empt a load failure with a less useful error that would otherwise occur.
Unfortunately I can't remember in which mod I originally saw this feature, and I can't find anything that would achieve this in the documentation (it's entirely possible I just missed it). Can anyone suggest how to do it?