summaryrefslogtreecommitdiffstats
path: root/src/client
diff options
context:
space:
mode:
authorSimon Rettberg2023-03-13 12:23:40 +0100
committerSimon Rettberg2023-03-13 12:23:40 +0100
commita5bd11f3a75c2a2e1a9611db2aa1ae679c452aa8 (patch)
treef5daecfa1a0ae373aeeb388e7187a6c6550ca3b0 /src/client
parentAdd more debug output to discovery part (diff)
downloadpvs2-master.tar.gz
pvs2-master.tar.xz
pvs2-master.zip
[*] Better error handling and messagingHEADmaster
Server now properly sends a connection termination reason to the client, which will log it to the console, for better debugging.
Diffstat (limited to 'src/client')
-rw-r--r--src/client/net/serverconnection.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/client/net/serverconnection.cpp b/src/client/net/serverconnection.cpp
index aae7538..690ba23 100644
--- a/src/client/net/serverconnection.cpp
+++ b/src/client/net/serverconnection.cpp
@@ -103,6 +103,11 @@ void ServerConnection::handleMsg()
_lastData = QDateTime::currentMSecsSinceEpoch() + PING_TIMEOUT_MS;
const QString &id = _fromServer.getFieldString(_ID);
+ if (id == _ERROR) {
+ qWarning() << "Server sent error message:" << _fromServer.getFieldString(_ERROR);
+ return;
+ }
+
if (_authed == 0) {
if (id == _CHALLENGE) {
// Initial challenge request by server