How to implement @try in LUA?
lovecactus opened this issue · 1 comments
lovecactus commented
Is this possible in wax? Thanks!
intheway commented
local unsafeFun = function()
--put your code here which may cause exception
self:testThrowException({1,2});
end
local ret, msg = pcall(unsafeFun);
if ret == false then
--exception happened
end
print("ret=" .. tostring(ret) .." msg=" .. tostring(msg))