Is there a way of handling lua errors, so that I could tell my script to try and fix the issue? Like try…catch in other languages.
There is no try…catch statement in Lua, but consider using gm_luaerror for debugging only:
Damn, alright then.
Take a gander at xpcall and pcall in the documentation on lua.org. They sort of offer trapping.
[lua]local ok, err = pcall(function() – try equivalent
– do whatever here
if not ok then – catch equivalent