Board Thread:Lua Help/@comment-24473195-20140813090251/@comment-24473195-20140820155439

I think the best way is probably to have a "function main " that will call all other functions that will do the relevant work. That way I don't need to waste time looking for the error, like this:

function main(frame) local t = getArgs(frame) local t = doProcessing(frame) end

function debug (frame) s,e = pcall(main,frame) if (e) then return tostring(e) end end

That way it will always give useful feedback on the error. I just dislike the wikia's standard "script error" message. It is like saying "Poison somewhere". Without any context that message is pretty much useless.