replace std::runtime_exception with PrismLauncher Exception + add try/catch
This commit is contained in:
parent
8cf0c2029c
commit
0d830e56e9
2 changed files with 17 additions and 10 deletions
|
@ -145,9 +145,14 @@ class ServerPingTask : public Task {
|
|||
resolver->deleteLater();
|
||||
qDebug() << "Resolved Addresse for" << domain << ": " << ip << ":" << port;
|
||||
McClient client(nullptr, domain, ip, port);
|
||||
int online = client.getOnlinePlayers();
|
||||
qDebug() << "Online players: " << online;
|
||||
m_server.m_currentPlayers = online;
|
||||
|
||||
try {
|
||||
int online = client.getOnlinePlayers();
|
||||
qDebug() << "Online players: " << online;
|
||||
m_server.m_currentPlayers = online;
|
||||
} catch(const Exception& e) {
|
||||
qDebug() << "Failed to get online players: " << e.cause();
|
||||
}
|
||||
});
|
||||
resolver->ping();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue