Merge 79d82fc84154780c6e7a0b6de60e02fa3dfef0a3 into 0b9671313b14ffe839ecbd7dd2ae5ac7f6f05db8

This commit is contained in:
Zachary Vorhies 2025-04-11 19:30:08 +05:30 committed by GitHub
commit a07acf981c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -401,7 +401,18 @@ func (f *Fs) shouldRetry(ctx context.Context, resp *http.Response, err error) (b
}
return true, err
}
return f.shouldRetryNoReauth(ctx, resp, err)
shouldRetry, err := f.shouldRetryNoReauth(ctx, resp, err)
if !shouldRetry && resp != nil {
// Log details when not retrying to help with debugging
var peek []byte
if resp.Body != nil {
peek, _ = io.ReadAll(io.LimitReader(resp.Body, 50))
_ = resp.Body.Close()
}
fs.Debugf(f, "Not retrying HTTP response: status=%d headers=%v body=%q",
resp.StatusCode, resp.Header, string(peek))
}
return shouldRetry, err
}
// errorHandler parses a non 2xx error response into an error