fix cloud error
This commit is contained in:
parent
25124cc295
commit
45e7f7d749
@ -40,7 +40,7 @@ public:
|
|||||||
CloudErrorNoError,
|
CloudErrorNoError,
|
||||||
CloudErrorAuthenticationFailed,
|
CloudErrorAuthenticationFailed,
|
||||||
CloudErrorCloudConnectionDisabled,
|
CloudErrorCloudConnectionDisabled,
|
||||||
CloudErrorIdentyServerNotReachable,
|
CloudErrorIdentityServerNotReachable,
|
||||||
CloudErrorProxyServerNotReachable,
|
CloudErrorProxyServerNotReachable,
|
||||||
CloudErrorLoginCredentialsMissing
|
CloudErrorLoginCredentialsMissing
|
||||||
};
|
};
|
||||||
|
|||||||
@ -209,6 +209,14 @@ void CloudAuthenticator::replyFinished(QNetworkReply *reply)
|
|||||||
QByteArray data = reply->readAll();
|
QByteArray data = reply->readAll();
|
||||||
m_tokenRequests.removeAll(reply);
|
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
|
// check HTTP status code
|
||||||
if (status != 200) {
|
if (status != 200) {
|
||||||
qCWarning(dcCloud()) << "Authenticator: Request token reply HTTP error:" << status << reply->errorString();
|
qCWarning(dcCloud()) << "Authenticator: Request token reply HTTP error:" << status << reply->errorString();
|
||||||
@ -250,6 +258,14 @@ void CloudAuthenticator::replyFinished(QNetworkReply *reply)
|
|||||||
QByteArray data = reply->readAll();
|
QByteArray data = reply->readAll();
|
||||||
m_refreshTokenRequests.removeAll(reply);
|
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
|
// check HTTP status code
|
||||||
if (status != 200) {
|
if (status != 200) {
|
||||||
qCWarning(dcCloud()) << "Authenticator: Refresh token reply HTTP error:" << status << reply->errorString();
|
qCWarning(dcCloud()) << "Authenticator: Refresh token reply HTTP error:" << status << reply->errorString();
|
||||||
|
|||||||
@ -590,7 +590,7 @@
|
|||||||
"CloudErrorNoError",
|
"CloudErrorNoError",
|
||||||
"CloudErrorAuthenticationFailed",
|
"CloudErrorAuthenticationFailed",
|
||||||
"CloudErrorCloudConnectionDisabled",
|
"CloudErrorCloudConnectionDisabled",
|
||||||
"CloudErrorIdentyServerNotReachable",
|
"CloudErrorIdentityServerNotReachable",
|
||||||
"CloudErrorProxyServerNotReachable",
|
"CloudErrorProxyServerNotReachable",
|
||||||
"CloudErrorLoginCredentialsMissing"
|
"CloudErrorLoginCredentialsMissing"
|
||||||
],
|
],
|
||||||
|
|||||||
Reference in New Issue
Block a user