commit e0e0d36: [Minor] Lpeg: Improve logging on type mismatch

Vsevolod Stakhov vsevolod at highsecure.ru
Mon Feb 24 09:56:07 UTC 2020


Author: Vsevolod Stakhov
Date: 2020-02-24 09:49:30 +0000
URL: https://github.com/rspamd/rspamd/commit/e0e0d361a445a4f5cca9bdc77a23dbdfe75bebed (HEAD -> master)

[Minor] Lpeg: Improve logging on type mismatch

---
 contrib/lua-lpeg/lptree.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/contrib/lua-lpeg/lptree.c b/contrib/lua-lpeg/lptree.c
index f4a58dbf0..4920f8f89 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;


More information about the Commits mailing list