mirror of
https://github.com/lua/lua
synced 2024-11-26 22:59:35 +03:00
better error message
This commit is contained in:
parent
90de38bf1f
commit
05348d834b
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
** $Id: lauxlib.c,v 1.134 2005/05/25 13:21:26 roberto Exp roberto $
|
** $Id: lauxlib.c,v 1.135 2005/05/31 14:25:18 roberto Exp roberto $
|
||||||
** Auxiliary functions for building Lua libraries
|
** Auxiliary functions for building Lua libraries
|
||||||
** See Copyright Notice in lua.h
|
** See Copyright Notice in lua.h
|
||||||
*/
|
*/
|
||||||
@ -103,7 +103,8 @@ LUALIB_API int luaL_checkoption (lua_State *L, int narg, const char *def,
|
|||||||
for (i=0; lst[i]; i++)
|
for (i=0; lst[i]; i++)
|
||||||
if (strcmp(lst[i], name) == 0)
|
if (strcmp(lst[i], name) == 0)
|
||||||
return i;
|
return i;
|
||||||
return luaL_error(L, "invalid option " LUA_QS, name);
|
return luaL_argerror(L, narg,
|
||||||
|
lua_pushfstring(L, "invalid option " LUA_QS, name));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user