|
|
||
|
Hi there,I just wrote a TRY..CATCH extension for Lua, and adapted it into version 5.1.3. Thesyntax is like this:try... (block) ...endIf error occurs in the block, the control immediately jumps to the first statement after END, andthe error will be ignored.another form,try... (block) ...catch err do... (handler) ...endWhere err is a variable local to the handler block, which holds the error object thrown in error(),then we can handle the error object in handler block.Traditional pcall() and xpcall() behavior is intact. You can nest pcall() and try..catch as you want.The difference is, you can call coroutine.yield() (or lua_yield in C) in try..catch block. The implementationis platform independent. It uses setjmp...longjmp mechanism so it may not be quite compatible withC++.I'm new to the mailing list, Could anyone tell me how and where to post the patch, or just attachit in the mail? Thanks.Hu