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

(cherry-picked from commit 19d9e150e1)
This commit is contained in:
loonycyborg 2018-04-12 14:30:45 +03:00
parent 368e5cb7a7
commit 99da3421ab

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;
}