From a5e5aa5be978d2f6e23d4eeab04d2ac9beefe170 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?B=C5=99etislav=20=C5=A0tec?= Date: Sat, 1 Aug 2015 22:52:28 +0200 Subject: Prepend "Lua: " before lua exceptions src/server.cpp src/emerge.cpp --- src/server.cpp | 29 +++++++++-------------------- 1 file changed, 9 insertions(+), 20 deletions(-) (limited to 'src/server.cpp') diff --git a/src/server.cpp b/src/server.cpp index 70fe5ae2c..8a1465faa 100644 --- a/src/server.cpp +++ b/src/server.cpp @@ -86,7 +86,7 @@ public: void * Thread(); }; -void * ServerThread::Thread() +void *ServerThread::Thread() { log_register_thread("ServerThread"); @@ -99,33 +99,22 @@ void * ServerThread::Thread() porting::setThreadName("ServerThread"); - while(!StopRequested()) - { - try{ + while (!StopRequested()) { + try { //TimeTaker timer("AsyncRunStep() + Receive()"); m_server->AsyncRunStep(); m_server->Receive(); - } - catch(con::NoIncomingDataException &e) - { - } - catch(con::PeerNotFoundException &e) - { + } catch (con::NoIncomingDataException &e) { + } catch (con::PeerNotFoundException &e) { infostream<<"Server: PeerNotFoundException"<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())); } } -- cgit v1.2.3