lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


>> One way to re-implement is to turn on WRAPFUNC every time
>> pcall() is called. Is this a good solution?
> That's not how it works and not something you should do. You turn
> this option on _once_ and then leave it on.
> If you use the wrapper function given in the docs, that's all you
> need to do. No need to override pcall() etc.

Thank you for making it clear.

>> An alternative solution would look like:
>
> It doesn't catch regular Lua errors -- I'm not sure you want that.
> And this solution is only ok, if you call it rarely and then run
> most of the time inside the called code (without errors).

In my case it does, since I have reset lua_atpanic to
throw an exception as well.

Why is it only OK if called rarely? Is the built-in pcall()
significantly different?

-- 
kostja