aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKitsune Ral <Kitsune-Ral@users.sf.net>2020-12-23 17:18:12 +0100
committerKitsune Ral <Kitsune-Ral@users.sf.net>2020-12-23 17:18:44 +0100
commit104356d945671762af23e346f7898a3208770d97 (patch)
treeb5947b3940bf368d497d9d5d007afd1691ac3338
parent97b0beca9becb0513111801ba3380f29e44383b2 (diff)
downloadlibquotient-104356d945671762af23e346f7898a3208770d97.tar.gz
libquotient-104356d945671762af23e346f7898a3208770d97.zip
Connection::resolveServer(): fix error handling
Part of the fix for #421.
-rw-r--r--lib/connection.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/connection.cpp b/lib/connection.cpp
index b6a3198d..8c51c84c 100644
--- a/lib/connection.cpp
+++ b/lib/connection.cpp
@@ -270,8 +270,8 @@ void Connection::resolveServer(const QString& mxid)
d->data->setBaseUrl(maybeBaseUrl); // Just enough to check .well-known file
d->resolverJob = callApi<GetWellknownJob>();
connect(d->resolverJob, &BaseJob::finished, this, [this, maybeBaseUrl] {
- if (d->resolverJob->status() != BaseJob::NotFoundError) {
- if (d->resolverJob->status() != BaseJob::Success) {
+ if (d->resolverJob->error() != BaseJob::NotFoundError) {
+ if (!d->resolverJob->status().good()) {
qCWarning(MAIN)
<< "Fetching .well-known file failed, FAIL_PROMPT";
emit resolveError(tr("Failed resolving the homeserver"));
@@ -301,8 +301,7 @@ void Connection::resolveServer(const QString& mxid)
&Connection::resolved);
connect(d->loginFlowsJob, &BaseJob::failure, this, [this] {
qCWarning(MAIN) << "Homeserver base URL sanity check failed";
- emit resolveError(
- tr("The homeserver base URL doesn't seem to work"));
+ emit resolveError(tr("The homeserver doesn't seem to be working"));
});
});
}