From: Vsevolod Stakhov Date: Mon, 24 Feb 2020 09:49:30 +0000 (+0000) Subject: [Minor] Lpeg: Improve logging on type mismatch X-Git-Tag: 2.4~22 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e0e0d361a445a4f5cca9bdc77a23dbdfe75bebed;p=thirdparty%2Frspamd.git [Minor] Lpeg: Improve logging on type mismatch --- diff --git a/contrib/lua-lpeg/lptree.c b/contrib/lua-lpeg/lptree.c index f4a58dbf04..4920f8f89a 100644 --- a/contrib/lua-lpeg/lptree.c +++ b/contrib/lua-lpeg/lptree.c @@ -1187,7 +1187,8 @@ static int lp_match (lua_State *L) { #ifdef LPEG_LUD_WORKAROUND lpeg_free_mem_low (capture); #endif - return luaL_error (L, "invalid argument"); + return luaL_error (L, "invalid argument: %s", + lua_typename (L, lua_type (L, SUBJIDX))); } size_t i = initposition(L, l); int ptop = lua_gettop(L), rs;