Prepend "Lua: " before lua exceptions

src/server.cpp
src/emerge.cpp
This commit is contained in:
Břetislav Štec 2015-08-01 22:52:28 +02:00 committed by kwolekr
parent c4287a0d68
commit a5e5aa5be9
2 changed files with 11 additions and 22 deletions

View File

@ -495,7 +495,7 @@ void *EmergeThread::Thread()
m_server->getScriptIface()->environment_OnGenerated(
minp, maxp, mapgen->blockseed);
} catch (LuaError &e) {
m_server->setAsyncFatalError(e.what());
m_server->setAsyncFatalError("Lua: " + std::string(e.what()));
}
EMERGE_DBG_OUT("ended up with: " << analyze_block(block));

View File

@ -99,8 +99,7 @@ void * ServerThread::Thread()
porting::setThreadName("ServerThread");
while(!StopRequested())
{
while (!StopRequested()) {
try {
//TimeTaker timer("AsyncRunStep() + Receive()");
@ -108,24 +107,14 @@ void * ServerThread::Thread()
m_server->Receive();
}
catch(con::NoIncomingDataException &e)
{
}
catch(con::PeerNotFoundException &e)
{
} catch (con::NoIncomingDataException &e) {
} catch (con::PeerNotFoundException &e) {
infostream<<"Server: PeerNotFoundException"<<std::endl;
}
catch(ClientNotFoundException &e)
{
}
catch(con::ConnectionBindFailed &e)
{
m_server->setAsyncFatalError(e.what());
}
catch(LuaError &e)
{
} catch (ClientNotFoundException &e) {
} catch (con::ConnectionBindFailed &e) {
m_server->setAsyncFatalError(e.what());
} catch (LuaError &e) {
m_server->setAsyncFatalError("Lua: " + std::string(e.what()));
}
}