aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLoic Blot <loic.blot@unix-experience.fr>2015-03-17 09:13:12 +0100
committerLoic Blot <loic.blot@unix-experience.fr>2015-03-17 15:26:20 +0100
commit768596927458d4d1d4ae7914526311471d242555 (patch)
tree80619a7712a6f7960cf6c2d2676103e23806237a /src
parent814e55597d3c3c1711825366d4345cee48d8fb87 (diff)
downloadminetest-768596927458d4d1d4ae7914526311471d242555.tar.gz
minetest-768596927458d4d1d4ae7914526311471d242555.tar.bz2
minetest-768596927458d4d1d4ae7914526311471d242555.zip
Server::step throw is never catched in minetestserver
Replace it with an errorstream + assert for server This throw can be trigger by LuaError exception or ConnectionBindFailed exception in the following functions: * EmergeThread::Thread() * ScriptApiEnv::environment_Step() * ScriptApiEnv::player_event() * ServerThread::Thread()
Diffstat (limited to 'src')
-rw-r--r--src/server.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/server.cpp b/src/server.cpp
index 18968cdf9..235e802bb 100644
--- a/src/server.cpp
+++ b/src/server.cpp
@@ -481,8 +481,16 @@ void Server::step(float dtime)
}
// Throw if fatal error occurred in thread
std::string async_err = m_async_fatal_error.get();
- if(async_err != ""){
- throw ServerError(async_err);
+ if(async_err != "") {
+ if (m_simple_singleplayer_mode) {
+ throw ServerError(async_err);
+ }
+ else {
+ errorstream << "UNRECOVERABLE error occurred. Stopping server. "
+ << "Please fix the following error:" << std::endl
+ << async_err << std::endl;
+ FATAL_ERROR(async_err.c_str());
+ }
}
}