lua-users home
lua-l archive

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



On 20-Aug-04, at 11:02 AM, Michael Newberry wrote:

lua_dofile returns 3.

Any Lua API which runs protected (i.e. returns an error status) should
be called with some variation on:

  if (lua_api(L,...)) {
    printf("%s\n", lua_tostring(L, -1));
  } else {
    ...
  }

or whatever your preferred style is.

Failing to take advantage of Lua's error messages is a good way to
make debugging more complicated. :)

Rici