Use DebugInfo functions in CFileHelpers::cp / lua cp

This commit is contained in:
M. Liebmann
2016-09-04 12:00:24 +02:00
parent 83a902d524
commit de07369d68
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;