It would be nice to have better error identification.
Right now when you get a simple error such as "String expected got table" you have to have either been retrying your script after each line edit to know where to look, or have a good feeling because you have been testing many things.
What would be nice is if the error told you the line of which the error occurred on. This could help more people figure out their own problems before having to seek help here.
Most of those errors come from Lua directly.
It has been my experience with everything lua I have ever interacted with (except for this obviously), always identifies the line as well as the value or function that contained a value other than expected. So instead of getting "String expected got table" it would say something like :
"error on line 172 with "coolvar" string expected got nil value file </user/location/directory/filename.lua> line 127 callstack "coolfunc()" "
Something to that degree. It doesn't have to be super detailed with an entire call stack (but that would be of most use), but at least the line where the error occurs and the variable name, that would be very beneficial.
That would be really awesome to have something like that
As a workaround I just ended up modifying _premake_main.lua to wrap the entry point in a xpcall to get a full stack trace
local function main()
p.callArray(m.elements)
end
function _premake_main()
local success, result = xpcall(main, debug.traceback)
if not success then
print(result)
return 1
end
return 0
end
This wrapper should be the default behaviour.
The standard error message just gives a line number in the middle of a comment block. It's utterly useless.