]> git.ipfire.org Git - thirdparty/rspamd.git/commitdiff
[Minor] Lpeg: Improve logging on type mismatch
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Mon, 24 Feb 2020 09:49:30 +0000 (09:49 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Mon, 24 Feb 2020 09:49:30 +0000 (09:49 +0000)
contrib/lua-lpeg/lptree.c

index f4a58dbf046ee811b13e6ae8d5a2326c13c2aabe..4920f8f89ae28ba94f7d01ffc99d2ac9bfb93b7d 100644 (file)
@@ -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;