Skip to content

Commit 5f8e48c

Browse files
committedMar 16, 2015
Server::step throw is never catched. Replace it with an errorstream + assert
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()
1 parent 16b961b commit 5f8e48c

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed
 

Diff for: ‎src/server.cpp

+6-3
Original file line numberDiff line numberDiff line change
@@ -479,10 +479,13 @@ void Server::step(float dtime)
479479
JMutexAutoLock lock(m_step_dtime_mutex);
480480
m_step_dtime += dtime;
481481
}
482-
// Throw if fatal error occurred in thread
482+
// Assert if fatal error occurred in thread
483483
std::string async_err = m_async_fatal_error.get();
484-
if(async_err != ""){
485-
throw ServerError(async_err);
484+
if(async_err != "") {
485+
errorstream << "UNRECOVERABLE error occurred. Stopping server. "
486+
<< "Please fix the following error:" << std::endl
487+
<< async_err << std::endl;
488+
assert(false);
486489
}
487490
}
488491

2 commit comments

Comments
 (2)

ShadowNinja commented on Mar 17, 2015

@ShadowNinja
Contributor

assert is a no-op in release builds. Use abort, or better yet proper error handling.

nerzhul commented on Mar 17, 2015

@nerzhul
ContributorAuthor

It was reverted and a better fix was pushed and provided, thanks anyway :)

Please sign in to comment.