[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: luaL_argcheck doesn't know function name if debug.traceback isn't used?
- From: Sam Roberts <vieuxtech@...>
- Date: Thu, 23 Aug 2012 13:56:22 -0700
I have a function that calls luaL_argcheck(), but when I call it with pcall:
print(pcall(mylib.read, 2))
I get:
.... bad argument #2 to '?' (attempt to read past end of ready data)
However, my top level call into lua (which uses the lua_pcall api and
provides debug.traceback as its err handler), as well as local calls
to xpcall:
print(xpcall(function () mylib.read(2) end, debug.traceback))
prints error msg strings with the function name:
... bad argument #2 to 'read'
Is that just the nature of things, that if debug.traceback isn't
called, information about function names on the stack aren't filled
in, and argcheck can't know the calling function's name?
Thanks,
Sam