2025-08-11 18:05:26 -07:00
|
|
|
function throw_error_with_arg(arg)
|
2023-07-01 11:58:00 -04:00
|
|
|
return "hello!"
|
|
|
|
|
end
|
|
|
|
|
|
2025-08-11 18:05:26 -07:00
|
|
|
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
|