lua-users home
lua-l archive

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



> -----Original Message-----
> From: lua-bounces@bazar2.conectiva.com.br [mailto:lua-
> bounces@bazar2.conectiva.com.br] On Behalf Of Patrick Donnelly
> Sent: Thursday, September 27, 2007 6:12 PM
> To: Lua list
> Subject: Re: Error handling in coroutines
>
> According to the manual, lua_resume() does return an error code:
>
> http://www.lua.org/manual/5.1/manual.html#lua_resume
>
> What I believe what happened was you tried to resume the coroutine
> when there was an error previously. Perhaps you need to check if there
> was an error, and if there was, print the value at the top of the
> stack (the error message). Review:
>
> http://www.lua.org/manual/5.1/manual.html#lua_pcall
>
> for more on error messages.
>
> HTH,
>
> --
> -Patrick Donnelly
>

Not the correct solution, but your response pushed me in the right direction.  lua_resume() was actually returning an error code.  I brilliantly printed out the error code with an unprotected call to luaL_error(), which triggered the panic.  Rookie mistake.

Thanks again,
Mike