Skip to content

Commit

Permalink
Connection::resolveServer(): fix error handling
Browse files Browse the repository at this point in the history
Part of the fix for quotient-im#421.

(cherry picked from commit 104356d945671762af23e346f7898a3208770d97)
  • Loading branch information
KitsuneRal committed Dec 23, 2020
1 parent 42b78ce commit 3ef036c
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions lib/connection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"));
Expand Down Expand Up @@ -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"));
});
});
}
Expand Down

0 comments on commit 3ef036c

Please sign in to comment.