mirror of
https://github.com/lua/lua
synced 2024-11-22 12:51:30 +03:00
better error message
This commit is contained in:
parent
9b5ae6faf9
commit
88f9843eee
@ -1,5 +1,5 @@
|
||||
/*
|
||||
** $Id: lstrlib.c,v 1.125 2005/10/19 13:05:11 roberto Exp roberto $
|
||||
** $Id: lstrlib.c,v 1.126 2005/10/23 17:46:30 roberto Exp roberto $
|
||||
** Standard library for string operations and pattern-matching
|
||||
** See Copyright Notice in lua.h
|
||||
*/
|
||||
@ -639,7 +639,7 @@ static void add_value (MatchState *ms, luaL_Buffer *b, const char *s,
|
||||
lua_pushlstring(L, s, e - s); /* keep original text */
|
||||
}
|
||||
else if (!lua_isstring(L, -1))
|
||||
luaL_error(L, "invalid replacement value");
|
||||
luaL_error(L, "invalid replacement value (a %s)", luaL_typename(L, -1));
|
||||
luaL_addvalue(b); /* add result to accumulator */
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user