servers: convert the rest of throw statements for server_shutdown

This commit is contained in:
loonycyborg 2021-12-22 14:39:50 +03:00
parent 13643e30d2
commit 03679821b4
No known key found for this signature in database
GPG key ID: 6E8233FAB8F26D61
2 changed files with 4 additions and 4 deletions

View file

@ -543,7 +543,7 @@ void server::handle_read_from_fifo(const boost::system::error_code& error, std::
if(ctl == "shut_down") {
LOG_CS << "Shut down requested by admin, shutting down...\n";
throw server_shutdown("Shut down via fifo command");
BOOST_THROW_EXCEPTION(server_shutdown("Shut down via fifo command"));
} else if(ctl == "readonly") {
if(ctl.args_count()) {
cfg_["read_only"] = read_only_ = utils::string_bool(ctl[1], true);

View file

@ -294,7 +294,7 @@ void server::handle_graceful_timeout(const boost::system::error_code& error)
if(games().empty()) {
process_command("msg All games ended. Shutting down now. Reconnect to the new server instance.", "system");
throw server_shutdown("graceful shutdown timeout");
BOOST_THROW_EXCEPTION(server_shutdown("graceful shutdown timeout"));
} else {
timer_.expires_from_now(std::chrono::seconds(1));
timer_.async_wait(std::bind(&server::handle_graceful_timeout, this, std::placeholders::_1));
@ -317,7 +317,7 @@ void server::handle_lan_server_shutdown(const boost::system::error_code& error)
if(error)
return;
throw server_shutdown("lan server shutdown");
BOOST_THROW_EXCEPTION(server_shutdown("lan server shutdown"));
}
void server::setup_fifo()
@ -2092,7 +2092,7 @@ void server::shut_down_handler(
}
if(parameters == "now") {
throw server_shutdown("shut down by admin command");
BOOST_THROW_EXCEPTION(server_shutdown("shut down by admin command"));
} else {
// Graceful shut down.
graceful_restart = true;