I call lua_pcall like this.
lua_pushcfunction(luaState , LuaErrorFunc );
lua_getglobal(luaState, "UpdateRoutines" );
if( !lua_isnil(luaState , -1 ) )
{
int numberOfParams = 0;
int status = lua_pcall( luaState , numberOfParams , 0, -(numberOfParams+2) );
if ( status != 0 )
puts( lua_tostring( luaState, -1 ) );
}
thanks
EDIT: I figured it out. I completely forgot that coroutines are protected calls and won't raise errors, but instead return them.