From 381089a0404eecbb693f5c7cb1000ecf3f58f4cc Mon Sep 17 00:00:00 2001 From: Kitsune Ral Date: Sat, 2 Jun 2018 22:55:50 +0900 Subject: BaseJob: fix error handling for M_CONSENT_NOT_GIVEN --- lib/jobs/basejob.cpp | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/lib/jobs/basejob.cpp b/lib/jobs/basejob.cpp index 6ed9862f..6984f16f 100644 --- a/lib/jobs/basejob.cpp +++ b/lib/jobs/basejob.cpp @@ -315,13 +315,10 @@ void BaseJob::gotReply() } if (json.value("errcode").toString() == "M_CONSENT_NOT_GIVEN") { - auto urlString = json.value("consent_uri").toString(); - setStatus(UserConsentRequiredError, - tr("You must agree with the server's privacy policy; " - "please visit %1").arg(urlString)); - d->errorUrl = urlString; + d->status.code = UserConsentRequiredError; + d->errorUrl = json.value("consent_uri").toString(); } - if (!json.isEmpty()) // FIXME: The below is not localisable + else if (!json.isEmpty()) // FIXME: The below is not localisable setStatus(IncorrectRequestError, json.value("error").toString()); } } @@ -538,7 +535,7 @@ QString BaseJob::errorCaption() const case ContentAccessError: return tr("Access error"); case NotFoundError: - return tr("Requested data not found"); + return tr("Not found"); case IncorrectRequestError: return tr("Invalid request"); case IncorrectResponseError: -- cgit v1.2.3