Data update

This commit is contained in:
Ingy döt Net 2025-08-11 18:05:26 -07:00
parent 4d5544505c
commit 4924dd0264
3073 changed files with 55820 additions and 4408 deletions

View file

@ -6,6 +6,8 @@ end
-- 'status' is false if 'throw_error' threw an error
-- otherwise, when everything went well, it will be true.
-- 'errmsg' contains the error message, plus filename and line number of where the error occured
status, errmsg = pcall(throw_error)
-- 'errmsg' contains the error message, plus filename
-- and line number of where the error occurred
local status, errmsg = pcall(throw_error)
print("errmsg = ", errmsg)

View file

@ -1,8 +1,10 @@
function throw_error_with_argment(argument)
error(string.format("Whoops! argument = %s", argument))
function throw_error_with_arg(arg)
error(string.format("Whoops! argument = %s", arg))
-- won't ever appear, due to previous error() call
return "hello!"
end
status, errmsg = pcall(throw_error_with_argment, "foobar 123")
print("errmsg = ", errmsg)
local status, errmsg = pcall(throw_error_with_arg, "foobar 123")
if (status ~= 0) then
print("errmsg = ", errmsg)
end

View file

@ -1,6 +1,10 @@
function throw_error_with_argment(argument)
function throw_error_with_arg(arg)
return "hello!"
end
status, errmsg = pcall(throw_error_with_argment, "foobar 123")
print("errmsg = ", errmsg)
local status, result = pcall(throw_error_with_arg, "foobar 123")
if (status ~= 0)
print("function returned ", result, ", but had errors.")
else
print("result = ", result)
end