and the very first sentence:
I just wrote a TRY..CATCH extension for Lua, and adapted it into version 5.1.3
so, maybe pcall will work?
pcall (f, arg1, ···)
Calls the function f with the given arguments in protected mode. This means that if any error occurs inside the function f, it will not be passed further; instead, pcall intercepts the error and returns a status.