diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2005-05-31 11:31:50 -0300 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2005-05-31 11:31:50 -0300 |
| commit | 05348d834b48a4b0720d0576c797877b98642e63 (patch) | |
| tree | 26775f1fe1cd22274bdaa737ddff746ef55dcbf3 | |
| parent | 90de38bf1f85714526c30e42b670ca997ec45827 (diff) | |
| download | lua-05348d834b48a4b0720d0576c797877b98642e63.tar.gz lua-05348d834b48a4b0720d0576c797877b98642e63.tar.bz2 lua-05348d834b48a4b0720d0576c797877b98642e63.zip | |
better error message
| -rw-r--r-- | lauxlib.c | 5 |
1 files changed, 3 insertions, 2 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: lauxlib.c,v 1.134 2005/05/25 13:21:26 roberto Exp roberto $ | 2 | ** $Id: lauxlib.c,v 1.135 2005/05/31 14:25:18 roberto Exp roberto $ |
| 3 | ** Auxiliary functions for building Lua libraries | 3 | ** Auxiliary functions for building Lua libraries |
| 4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
| 5 | */ | 5 | */ |
| @@ -103,7 +103,8 @@ LUALIB_API int luaL_checkoption (lua_State *L, int narg, const char *def, | |||
| 103 | for (i=0; lst[i]; i++) | 103 | for (i=0; lst[i]; i++) |
| 104 | if (strcmp(lst[i], name) == 0) | 104 | if (strcmp(lst[i], name) == 0) |
| 105 | return i; | 105 | return i; |
| 106 | return luaL_error(L, "invalid option " LUA_QS, name); | 106 | return luaL_argerror(L, narg, |
| 107 | lua_pushfstring(L, "invalid option " LUA_QS, name)); | ||
| 107 | } | 108 | } |
| 108 | 109 | ||
| 109 | 110 | ||
