From 70f396535435a9ea7df57ac00c7850f99841afc6 Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Tue, 10 Sep 2024 11:46:04 +0100 Subject: [PATCH] onedrive: fix spurious "Couldn't decode error response: EOF" DEBUG This DEBUG was being generated on redirects which don't have a JSON body and is irrelevant. --- backend/onedrive/onedrive.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/backend/onedrive/onedrive.go b/backend/onedrive/onedrive.go index 6aad7d177..7db269c2f 100644 --- a/backend/onedrive/onedrive.go +++ b/backend/onedrive/onedrive.go @@ -942,7 +942,8 @@ func errorHandler(resp *http.Response) error { // Decode error response errResponse := new(api.Error) err := rest.DecodeJSON(resp, &errResponse) - if err != nil { + // Redirects have no body so don't report an error + if err != nil && resp.Header.Get("Location") == "" { fs.Debugf(nil, "Couldn't decode error response: %v", err) } if errResponse.ErrorInfo.Code == "" {