fix cloud error

This commit is contained in:
Simon Stürz 2016-06-20 12:44:23 +02:00 committed by Michael Zanetti
parent 25124cc295
commit 45e7f7d749
3 changed files with 18 additions and 2 deletions

View File

@ -40,7 +40,7 @@ public:
CloudErrorNoError,
CloudErrorAuthenticationFailed,
CloudErrorCloudConnectionDisabled,
CloudErrorIdentyServerNotReachable,
CloudErrorIdentityServerNotReachable,
CloudErrorProxyServerNotReachable,
CloudErrorLoginCredentialsMissing
};

View File

@ -209,6 +209,14 @@ void CloudAuthenticator::replyFinished(QNetworkReply *reply)
QByteArray data = reply->readAll();
m_tokenRequests.removeAll(reply);
if (reply->error() != QNetworkReply::NoError) {
qCWarning(dcCloud()) << "Authenticator: Request token reply error:" << status << reply->errorString();
m_error = Cloud::CloudErrorIdentityServerNotReachable;
setAuthenticated(false);
reply->deleteLater();
return;
}
// check HTTP status code
if (status != 200) {
qCWarning(dcCloud()) << "Authenticator: Request token reply HTTP error:" << status << reply->errorString();
@ -250,6 +258,14 @@ void CloudAuthenticator::replyFinished(QNetworkReply *reply)
QByteArray data = reply->readAll();
m_refreshTokenRequests.removeAll(reply);
if (reply->error() != QNetworkReply::NoError) {
qCWarning(dcCloud()) << "Authenticator: Request token reply error:" << status << reply->errorString();
m_error = Cloud::CloudErrorIdentityServerNotReachable;
setAuthenticated(false);
reply->deleteLater();
return;
}
// check HTTP status code
if (status != 200) {
qCWarning(dcCloud()) << "Authenticator: Refresh token reply HTTP error:" << status << reply->errorString();

View File

@ -590,7 +590,7 @@
"CloudErrorNoError",
"CloudErrorAuthenticationFailed",
"CloudErrorCloudConnectionDisabled",
"CloudErrorIdentyServerNotReachable",
"CloudErrorIdentityServerNotReachable",
"CloudErrorProxyServerNotReachable",
"CloudErrorLoginCredentialsMissing"
],