mirror of
https://github.com/vcmi/vcmi.git
synced 2024-11-28 08:48:48 +02:00
Show appropriate error message on lobby server startup failure
This commit is contained in:
parent
ace43e97b9
commit
536156dd92
@ -35,7 +35,15 @@ int main(int argc, const char * argv[])
|
||||
LobbyServer server(databasePath);
|
||||
logGlobal->info("Starting server on port %d", LISTENING_PORT);
|
||||
|
||||
server.start(LISTENING_PORT);
|
||||
try
|
||||
{
|
||||
server.start(LISTENING_PORT);
|
||||
}
|
||||
catch (const boost::system::system_error & e)
|
||||
{
|
||||
logGlobal->error("Failed to start server! Another server already uses the same port? Reason: '%s'", e.what());
|
||||
return 1;
|
||||
}
|
||||
server.run();
|
||||
|
||||
return 0;
|
||||
|
Loading…
Reference in New Issue
Block a user