diff --git a/client/core/api/apiUtils.cpp b/client/core/api/apiUtils.cpp index 9f518b52..be19a166 100644 --- a/client/core/api/apiUtils.cpp +++ b/client/core/api/apiUtils.cpp @@ -66,6 +66,7 @@ amnezia::ErrorCode apiUtils::checkNetworkReplyErrors(const QList &ssl return amnezia::ErrorCode::NoError; } else if (reply->error() == QNetworkReply::NetworkError::OperationCanceledError || reply->error() == QNetworkReply::NetworkError::TimeoutError) { + qDebug() << reply->error(); return amnezia::ErrorCode::ApiConfigTimeoutError; } else { QString err = reply->errorString(); diff --git a/client/core/controllers/gatewayController.cpp b/client/core/controllers/gatewayController.cpp index be42ad4d..f8c23c1a 100644 --- a/client/core/controllers/gatewayController.cpp +++ b/client/core/controllers/gatewayController.cpp @@ -251,6 +251,9 @@ QStringList GatewayController::getProxyUrls() } return endpoints; } else { + apiUtils::checkNetworkReplyErrors(sslErrors, reply); + qDebug() << "go to the next storage endpoint"; + reply->deleteLater(); } } @@ -261,26 +264,29 @@ bool GatewayController::shouldBypassProxy(QNetworkReply *reply, const QByteArray const QByteArray &iv, const QByteArray &salt) { if (reply->error() == QNetworkReply::NetworkError::OperationCanceledError || reply->error() == QNetworkReply::NetworkError::TimeoutError) { - qDebug() << "Timeout occurred"; + qDebug() << "timeout occurred"; + qDebug() << reply->error(); return true; } else if (responseBody.contains("html")) { - qDebug() << "The response contains an html tag"; + qDebug() << "the response contains an html tag"; return true; } else if (reply->error() == QNetworkReply::NetworkError::ContentNotFoundError) { if (responseBody.contains(errorResponsePattern1) || responseBody.contains(errorResponsePattern2) || responseBody.contains(errorResponsePattern3)) { return false; } else { + qDebug() << reply->error(); return true; } } else if (reply->error() != QNetworkReply::NetworkError::NoError) { + qDebug() << reply->error(); return true; } else if (checkEncryption) { try { QSimpleCrypto::QBlockCipher blockCipher; static_cast(blockCipher.decryptAesBlockCipher(responseBody, key, iv, "", salt)); } catch (...) { - qDebug() << "Failed to decrypt the data"; + qDebug() << "failed to decrypt the data"; return true; } } @@ -301,7 +307,7 @@ void GatewayController::bypassProxy(const QString &endpoint, QNetworkReply *repl QByteArray responseBody; for (const QString &proxyUrl : proxyUrls) { - qDebug() << "Go to the next endpoint"; + qDebug() << "go to the next proxy endpoint"; reply->deleteLater(); // delete the previous reply reply = requestFunction(endpoint.arg(proxyUrl));