Code: Select all
function _error_invalid_key()
return game.invalid_key
end
function _error_lua_error()
return 1-nil
end
commands.add_command('invalid-key','just for testing',function(event)
local success, err = pcall(_error_invalid_key)
log(err)
game.print(err)
end)
commands.add_command('lua-error','just for testing',function(event)
local success, err = pcall(_error_lua_error)
log(err)
game.print(err)
end)
Results
TL;DRServer has a diffrent path to clients but only before the temp dir.
When it is a lua error there is basic traceback ''attempt to perform arithmetic on a nil value"
When it is a an invalid index on a object there is a full trace back with includes all pcalls "LuaGameScript doesn't contain key invalid_key. stack traceback: [stuff here] [C]: in function 'pcall' [stuff here] [C]: in function 'pcall' [stuff here]"
As these are being ran from a command, and the user input is what will cause the error (in context im using pcall(loadstring(input)) and want to return error), this should not cause a desync.
When I run my script (not shown) the full trace back given by an invalid key causes desyncs but the short traceback given by lua errors does not.
Context see point above
Given that the longer tracebacks are only given when there is a factorio object envolded i am reporting it has a bug, as the longer trace back is not given for the lua errors because of pcall, but factorio objects still give an full traceback even from within a pcall.