From a5bd11f3a75c2a2e1a9611db2aa1ae679c452aa8 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Mon, 13 Mar 2023 12:23:40 +0100 Subject: [*] Better error handling and messaging Server now properly sends a connection termination reason to the client, which will log it to the console, for better debugging. --- src/client/net/serverconnection.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/client/net/serverconnection.cpp') 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 -- cgit v1.2.3-55-g7522