Skip to content

Commit d72e0f0

Browse files
ncwyuval-cloudinary
authored andcommitted
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.
1 parent 6242a03 commit d72e0f0

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

backend/onedrive/onedrive.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -942,7 +942,8 @@ func errorHandler(resp *http.Response) error {
942942
// Decode error response
943943
errResponse := new(api.Error)
944944
err := rest.DecodeJSON(resp, &errResponse)
945-
if err != nil {
945+
// Redirects have no body so don't report an error
946+
if err != nil && resp.Header.Get("Location") == "" {
946947
fs.Debugf(nil, "Couldn't decode error response: %v", err)
947948
}
948949
if errResponse.ErrorInfo.Code == "" {

0 commit comments

Comments
 (0)