Hello!
On Tue, Jul 15, 2014 at 9:00 AM, Cefan Daniel Rubin wrote:
> Has anyone got any experience with where I should try to replace the "error"
> function of LuaJIT? I can of course replace the "error" function which is
> called from my own lua code but would like to also replace the function that
> is called when a syntax error or similar is encountered by LuaJIT. Thanks!
>
The LuaJIT VM does not always call the Lua-land "error" function
internally at all, probably due to performance reasons.
Instead of hijacking the "error" primitive function here, I think you
should just use the pcall() and xpcall() Lua primitives to capture Lua
exceptions on the top-level of your Lua app.
Best regards,
-agentzh