* Added lua tracebacks to some errors where you have been blind to what actually went wrong
m_server->getScriptIface()->environment_OnGenerated(
minp, maxp, m_mapgen->blockseed);
} catch (LuaError &e) {
- m_server->setAsyncFatalError("Lua: " + std::string(e.what()));
+ m_server->setAsyncFatalError("Lua: finishGen" + std::string(e.what()));
}
EMERGE_DBG_OUT("ended up with: " << analyze_block(block));
#include "util/serialize.h"
#include "util/string.h"
#include "common/c_converter.h"
+#include "common/c_internal.h"
#include "constants.h"
#define CHECK_TYPE(index, name, type) do { \
int t = lua_type(L, (index)); \
if (t != (type)) { \
+ std::string traceback = script_get_backtrace(L); \
throw LuaError(std::string("Invalid ") + (name) + \
" (expected " + lua_typename(L, (type)) + \
- " got " + lua_typename(L, t) + ")."); \
+ " got " + lua_typename(L, t) + ").\n" + traceback); \
} \
} while(0)
#define CHECK_POS_COORD(name) CHECK_TYPE(-1, "position coordinate '" name "'", LUA_TNUMBER)
try {
runCallbacks(1, RUN_CALLBACKS_MODE_FIRST);
} catch (LuaError &e) {
- getServer()->setAsyncFatalError(e.what());
+ getServer()->setAsyncFatalError(
+ std::string("environment_Step: ") + e.what() + "\n"
+ + script_get_backtrace(L));
}
}
try {
runCallbacks(2, RUN_CALLBACKS_MODE_FIRST);
} catch (LuaError &e) {
- getServer()->setAsyncFatalError(e.what());
+ getServer()->setAsyncFatalError(
+ std::string("player_event: ") + e.what() + "\n"
+ + script_get_backtrace(L) );
}
}
try {
PCALL_RES(lua_pcall(L, 4, 0, error_handler));
} catch (LuaError &e) {
- server->setAsyncFatalError(e.what());
+ server->setAsyncFatalError(
+ std::string("on_emerge_area_completion: ") + e.what() + "\n"
+ + script_get_backtrace(L));
}
lua_pop(L, 1); // Pop error handler
} catch (con::ConnectionBindFailed &e) {
m_server->setAsyncFatalError(e.what());
} catch (LuaError &e) {
- m_server->setAsyncFatalError("Lua: " + std::string(e.what()));
+ m_server->setAsyncFatalError(
+ "ServerThread::run Lua: " + std::string(e.what()));
}
}
g_settings->get("kick_msg_crash"),
g_settings->getBool("ask_reconnect_on_crash"));
}
- throw ServerError(async_err);
+ throw ServerError("AsyncErr: " + async_err);
}
}