lua-users home
lua-l archive

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


Here is a possible implementation (modification of the existing function).

static int luaB_auxwrap (lua_State *L) {
  lua_State *co = lua_tothread(L, lua_upvalueindex(1));
  int r = auxresume(L, co, lua_gettop(L));
  if (r < 0)
  {
    /* I JUST ADDED THOSE 3 LINES */
    luaL_where(L,1);
    lua_insert(L,-2);
    lua_concat(L,2);
    /* END OF MODIFICATION */
    lua_error(L);  /* propagate error */
  }
  return r;
}


BTW, I spoke about the "[chunk id]:<line>: message" format, but is this a de
facto standardized
message format that all errors raised by the core or the standard libraries
should (be expected to)
follow ?


Regards,

Benoit.