aboutsummaryrefslogtreecommitdiff
path: root/backends
diff options
context:
space:
mode:
Diffstat (limited to 'backends')
-rw-r--r--backends/cloud/googledrive/googledrivetokenrefresher.cpp6
-rw-r--r--backends/cloud/onedrive/onedrivetokenrefresher.cpp6
2 files changed, 8 insertions, 4 deletions
diff --git a/backends/cloud/googledrive/googledrivetokenrefresher.cpp b/backends/cloud/googledrive/googledrivetokenrefresher.cpp
index b876bc2995..1b858504c5 100644
--- a/backends/cloud/googledrive/googledrivetokenrefresher.cpp
+++ b/backends/cloud/googledrive/googledrivetokenrefresher.cpp
@@ -64,10 +64,12 @@ void GoogleDriveTokenRefresher::finishJson(Common::JSONValue *json) {
}
Common::JSONObject result = json->asObject();
+ long httpResponseCode = -1;
if (result.contains("error")) {
//new token needed => request token & then retry original request
if (_stream) {
- debug(9, "code %ld", _stream->httpResponseCode());
+ httpResponseCode = _stream->httpResponseCode();
+ debug(9, "code %ld", httpResponseCode);
}
Common::JSONObject error = result.getVal("error")->asObject();
@@ -89,7 +91,7 @@ void GoogleDriveTokenRefresher::finishJson(Common::JSONValue *json) {
irrecoverable = false;
if (irrecoverable) {
- finishError(Networking::ErrorResponse(this, false, true, json->stringify(true), -1)); //TODO: httpCode
+ finishError(Networking::ErrorResponse(this, false, true, json->stringify(true), httpResponseCode));
delete json;
return;
}
diff --git a/backends/cloud/onedrive/onedrivetokenrefresher.cpp b/backends/cloud/onedrive/onedrivetokenrefresher.cpp
index 88b5154d8a..3e429f1ef8 100644
--- a/backends/cloud/onedrive/onedrivetokenrefresher.cpp
+++ b/backends/cloud/onedrive/onedrivetokenrefresher.cpp
@@ -64,10 +64,12 @@ void OneDriveTokenRefresher::finishJson(Common::JSONValue *json) {
}
Common::JSONObject result = json->asObject();
+ long httpResponseCode = -1;
if (result.contains("error")) {
//new token needed => request token & then retry original request
if (_stream) {
- debug(9, "code %ld", _stream->httpResponseCode());
+ httpResponseCode = _stream->httpResponseCode();
+ debug(9, "code %ld", httpResponseCode);
}
Common::JSONObject error = result.getVal("error")->asObject();
@@ -93,7 +95,7 @@ void OneDriveTokenRefresher::finishJson(Common::JSONValue *json) {
if (code == "unauthenticated") irrecoverable = false;
if (irrecoverable) {
- finishError(Networking::ErrorResponse(this, false, true, json->stringify(true), -1)); //TODO: httpCode
+ finishError(Networking::ErrorResponse(this, false, true, json->stringify(true), httpResponseCode));
delete json;
return;
}