Fix issue #1757: prevent abnormal termination if failed to bind address

This commit is contained in:
loonycyborg 2018-04-12 14:30:45 +03:00
parent cfd5d5289d
commit 19d9e150e1

View file

@ -2836,7 +2836,12 @@ int main(int argc, char** argv) {
}
}
wesnothd::server(port, keep_alive, config_file, min_threads, max_threads).run();
try {
wesnothd::server(port, keep_alive, config_file, min_threads, max_threads).run();
} catch(std::exception& e) {
ERR_SERVER << "terminated by C++ exception: " << e.what() << std::endl;
return 1;
}
return 0;
}