Page 1 of 1

[0.16.51]Syntax errors not caught in settings stage

Posted: Mon Sep 10, 2018 2:30 pm
by mrudat
What did I do?
Writing a mod, I forgot an 'end' which of course is a syntax error.
What happened?
The error was caught by what I presume is the built-in Lua error handler. I got an error message dialogue that reads (using my simplified test case):
Failed to load mod "Syntax_error_test": __Syntax_error_test__/settings.lua:1: 'end' expected near <eof>
with an 'OK' button that would cause factorio to close.
What did I expect?
I expected the 'this mod had an oops' dialogue box that allows you to disable the mods that (probably) have a problem, all mods, restart or exit.

It appears that syntax errors aren't caught in the settings phase. I tested with a syntax error in data.lua, and that was caught successfully. Presumably the other phases will catch syntax errors more gracefully.
simplest possible code that fails
a settings, settings-updates or settings-final-fixes that consists of the keyword 'do' (and no end).

Code: Select all

do

Re: [0.16.51]Syntax errors not caught in settings stage

Posted: Thu Oct 25, 2018 10:45 pm
by Rseding91
Thanks for the report. It's now fixed for 0.17.