]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Show real message on lua load errors
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Sat, 22 Oct 2016 11:26:45 +0000 (12:26 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Sat, 22 Oct 2016 11:26:45 +0000 (12:26 +0100)
src/rspamadm/lua_repl.c

index ce764c7f8e29916ec2a9a104e40752a9daee3463..0245617338b5f2a4a03ebd017903029c0050c69f 100644 (file)
@@ -170,7 +170,7 @@ rspamadm_lua_load_script (lua_State *L, const gchar *path)
 
        if (luaL_loadfile (L, path) != 0) {
                rspamd_fprintf (stderr, "cannot load script %s: %s\n",
-                               path, strerror (errno));
+                               path, lua_tostring (L, -1));
                lua_settop (L, 0);
 
                return FALSE;
@@ -299,7 +299,7 @@ rspamadm_lua_exec_handler (lua_State *L, gint argc, gchar **argv)
 
                if (luaL_loadfile (L, argv[i]) != 0) {
                        rspamd_fprintf (stderr, "cannot load script %s: %s\n",
-                                       argv[i], strerror (errno));
+                                       argv[i], lua_tostring (L, -1));
                        lua_settop (L, 0);
 
                        return;