summary refs log tree commit diff
path: root/src/MatrixClient.cc
diff options
context:
space:
mode:
authorKonstantinos Sideris <sideris.konstantin@gmail.com>2018-02-08 19:07:58 +0200
committerKonstantinos Sideris <sideris.konstantin@gmail.com>2018-02-08 19:07:58 +0200
commitb60554b8fdf42dc55cddcee059942096420c3e47 (patch)
treefa69164500bfdb0812681d73680be5dd447ea1f7 /src/MatrixClient.cc
parentMerge pull request #227 from christarazi/fix-text-wrap-checkmark (diff)
downloadnheko-b60554b8fdf42dc55cddcee059942096420c3e47.tar.xz
Add a timeout timer for initial sync (#223, #222)
Show a better message on the login screen after an initial sync failure.
Diffstat (limited to 'src/MatrixClient.cc')
-rw-r--r--src/MatrixClient.cc8
1 files changed, 5 insertions, 3 deletions
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; }