mirror of
https://github.com/luanti-org/luanti.git
synced 2025-08-11 17:51:04 +00:00
Clean up/improve some scriptapi error handling code
This commit is contained in:
parent
7423c4c11e
commit
766e885a1b
11 changed files with 120 additions and 94 deletions
|
@ -103,7 +103,13 @@ void *ServerThread::run()
|
|||
* doesn't busy wait) and will process any remaining packets.
|
||||
*/
|
||||
|
||||
m_server->AsyncRunStep(true);
|
||||
try {
|
||||
m_server->AsyncRunStep(true);
|
||||
} catch (con::ConnectionBindFailed &e) {
|
||||
m_server->setAsyncFatalError(e.what());
|
||||
} catch (LuaError &e) {
|
||||
m_server->setAsyncFatalError(e);
|
||||
}
|
||||
|
||||
while (!stopRequested()) {
|
||||
try {
|
||||
|
@ -117,8 +123,7 @@ void *ServerThread::run()
|
|||
} catch (con::ConnectionBindFailed &e) {
|
||||
m_server->setAsyncFatalError(e.what());
|
||||
} catch (LuaError &e) {
|
||||
m_server->setAsyncFatalError(
|
||||
"ServerThread::run Lua: " + std::string(e.what()));
|
||||
m_server->setAsyncFatalError(e);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue