[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: error handling
- From: Roberto Ierusalimschy <roberto@...>
- Date: Sun, 23 Dec 2012 17:08:53 -0200
> Sorry, I have confused with lua_pcall (the C fuction). So I just
> run a lua function with
>
> if pcall(myfunc()) then
> no error
> else
> error
> end
>
> A try-catch around a block does not work, so I must call each "function"
> with pcall, do I ?
if not pcall(function ()
foo1() -- 1st call
foo2() -- 2nd call
... -- whatever
end) then
error
end
-- Roberto