From b60554b8fdf42dc55cddcee059942096420c3e47 Mon Sep 17 00:00:00 2001 From: Konstantinos Sideris Date: Thu, 8 Feb 2018 19:07:58 +0200 Subject: Add a timeout timer for initial sync (#223, #222) Show a better message on the login screen after an initial sync failure. --- src/MatrixClient.cc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/MatrixClient.cc') diff --git a/src/MatrixClient.cc b/src/MatrixClient.cc index 69888719..b51c14c8 100644 --- a/src/MatrixClient.cc +++ b/src/MatrixClient.cc @@ -270,7 +270,7 @@ MatrixClient::sync() noexcept mtx::responses::Sync response = nlohmann::json::parse(data); emit syncCompleted(response); } catch (std::exception &e) { - qWarning() << "Sync malformed response: " << e.what(); + qWarning() << "Sync error: " << e.what(); } }); } @@ -384,7 +384,8 @@ MatrixClient::initialSync() noexcept int status = reply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt(); if (status == 0 || status >= 400) { - emit initialSyncFailed(reply->errorString()); + qDebug() << "Error code received" << status; + emit initialSyncFailed(); return; } @@ -394,7 +395,8 @@ MatrixClient::initialSync() noexcept mtx::responses::Sync response = nlohmann::json::parse(data); emit initialSyncCompleted(response); } catch (std::exception &e) { - qWarning() << "Sync malformed response" << e.what(); + qWarning() << "Initial sync error:" << e.what(); + emit initialSyncFailed(); return; } -- cgit 1.5.1