MCPcopy Create free account
hub / github.com/bloomberg/comdb2 / luaL_argerror

Function luaL_argerror

lua/lauxlib.c:45–60  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

43
44
45LUALIB_API int luaL_argerror (lua_State *L, int narg, const char *extramsg) {
46 lua_Debug ar;
47 if (!lua_getstack(L, 0, &ar)) /* no stack frame? */
48 return luaL_error(L, "bad argument #%d (%s)", narg, extramsg);
49 lua_getinfo(L, "n", &ar);
50 if (strcmp(ar.namewhat, "method") == 0) {
51 narg--; /* do not count `self' */
52 if (narg == 0) /* error is in the self argument itself? */
53 return luaL_error(L, "calling " LUA_QS " on bad self (%s)",
54 ar.name, extramsg);
55 }
56 if (ar.name == NULL)
57 ar.name = "?";
58 return luaL_error(L, "bad argument #%d to " LUA_QS " (%s)",
59 narg, ar.name, extramsg);
60}
61
62
63LUALIB_API int luaL_typerror (lua_State *L, int narg, const char *tname) {

Callers 10

getfuncFunction · 0.85
luaL_typerrorFunction · 0.85
luaL_checkoptionFunction · 0.85
luaL_checkanyFunction · 0.85
db_consumerFunction · 0.85
fileerrorFunction · 0.85
g_readFunction · 0.85
db_getinfoFunction · 0.85
db_getlocalFunction · 0.85
db_setlocalFunction · 0.85

Calls 3

lua_getstackFunction · 0.85
luaL_errorFunction · 0.85
lua_getinfoFunction · 0.85

Tested by

no test coverage detected