Use DebugInfo functions in CFileHelpers::cp / lua cp

Origin commit data
------------------
Commit: de07369d68
Author: Michael Liebmann <tuxcode.bbg@gmail.com>
Date: 2016-09-04 (Sun, 04 Sep 2016)
This commit is contained in:
Michael Liebmann
2016-09-04 12:00:24 +02:00
parent 9dc7398baa
commit 0143837e94
2 changed files with 29 additions and 7 deletions

View File

@@ -106,7 +106,17 @@ int CLuaInstFileHelpers::FileHelpersCp(lua_State *L)
bool ret = false;
CFileHelpers fh;
fh.setConsoleQuiet(true);
ret = fh.cp(from, to, flags);
if (ret == false) {
helpersDebugInfo di;
fh.readDebugInfo(&di);
lua_Debug ar;
lua_getstack(L, 1, &ar);
lua_getinfo(L, "Sl", &ar);
printf(">>> Lua script error [%s:%d] %s\n (error from neutrino: [%s:%d])\n",
ar.short_src, ar.currentline, di.msg.c_str(), di.file.c_str(), di.line);
}
lua_pushboolean(L, ret);
return 1;