From 273c56965e5b1c1553a986a6e535d9ca00f2847d Mon Sep 17 00:00:00 2001 From: VitorVieiraZ Date: Fri, 22 Nov 2024 11:40:26 -0300 Subject: [PATCH] adding new errors to isRetryableNetworkError --- core/merginapi.cpp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/core/merginapi.cpp b/core/merginapi.cpp index adc32b13a..62f2461a2 100644 --- a/core/merginapi.cpp +++ b/core/merginapi.cpp @@ -3960,17 +3960,18 @@ bool MerginApi::isRetryableNetworkError( QNetworkReply *reply ) Q_ASSERT( reply ); QNetworkReply::NetworkError err = reply->error(); - int httpCode = reply->attribute( QNetworkRequest::HttpStatusCodeAttribute ).toInt(); bool isRetryableError = ( err == QNetworkReply::TimeoutError || err == QNetworkReply::TemporaryNetworkFailureError || err == QNetworkReply::NetworkSessionFailedError || - err == QNetworkReply::UnknownNetworkError ); - - bool isRetryableHttpCode = ( httpCode == 500 || httpCode == 502 || - httpCode == 503 || httpCode == 504 ); - - return isRetryableError || isRetryableHttpCode; + err == QNetworkReply::UnknownNetworkError || + err == QNetworkReply::RemoteHostClosedError || + err == QNetworkReply::ProxyConnectionClosedError || + err == QNetworkReply::ProxyTimeoutError || + err == QNetworkReply::UnknownProxyError || + err == QNetworkReply::ServiceUnavailableError ); + + return isRetryableError; } void MerginApi::setNetworkManager( QNetworkAccessManager *manager )