lua-users home
lua-l archive

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

> Of course, all this does is generate a traceback; it is still
> necessary to check the return from coroutine.resume/lua_resume.

Just a minor addendum (since Rici sorted this out for me in the IRC 
channel -- thanks Rici!), you basically just wrap your call to 
coroutine.resume() in an assert and/or call your own resume function 
that checks the return values.

Works like a charm, and has saved me a HUGE amount of headache because 
I wasn't getting a traceback when things started exploding in my code 
(mostly to do with nil variables, calls to nil functions, the latter 
two mostly caused by typos/cut-paste errors).