Assuming we have the following function:
function foo(tab)
return tab.a
end -- Script execution errors out w/ a stacktrace when tab is not a table
Let's improve it a bit
function foo(tab)
if type(tab) ~= "table" then
error("Argument 1 is not a table!", 2)
end
...