mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Make Lua error output in log clearer
This commit is contained in:
parent
9101b680c0
commit
5ef78cd815
1 changed files with 7 additions and 4 deletions
|
@ -96,10 +96,13 @@ bool script_load(lua_State *L, const char *path)
|
||||||
|
|
||||||
int ret = luaL_loadfile(L, path) || lua_pcall(L, 0, 0, errorhandler);
|
int ret = luaL_loadfile(L, path) || lua_pcall(L, 0, 0, errorhandler);
|
||||||
if(ret){
|
if(ret){
|
||||||
errorstream<<"Failed to load and run script from "<<path<<":"<<std::endl;
|
errorstream<<"========== ERROR FROM LUA ==========="<<std::endl;
|
||||||
errorstream<<"[LUA] "<<std::endl;
|
errorstream<<"Failed to load and run script from "<<std::endl;
|
||||||
errorstream<<"[LUA] "<<lua_tostring(L, -1)<<std::endl;
|
errorstream<<path<<":"<<std::endl;
|
||||||
errorstream<<"[LUA] "<<std::endl;
|
errorstream<<std::endl;
|
||||||
|
errorstream<<lua_tostring(L, -1)<<std::endl;
|
||||||
|
errorstream<<std::endl;
|
||||||
|
errorstream<<"=======END OF ERROR FROM LUA ========"<<std::endl;
|
||||||
lua_pop(L, 1); // Pop error message from stack
|
lua_pop(L, 1); // Pop error message from stack
|
||||||
lua_pop(L, 1); // Pop the error handler from stack
|
lua_pop(L, 1); // Pop the error handler from stack
|
||||||
return false;
|
return false;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue