mirror of
https://github.com/rclone/rclone.git
synced 2025-04-16 16:18:52 +08:00
Merge 79d82fc84154780c6e7a0b6de60e02fa3dfef0a3 into 0b9671313b14ffe839ecbd7dd2ae5ac7f6f05db8
This commit is contained in:
commit
a07acf981c
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user