forked from TrueCloudLab/rclone
onedrive: Do not retry on 400 pathIsTooLong
This commit is contained in:
parent
ec72432cec
commit
7b1428a498
1 changed files with 6 additions and 0 deletions
|
@ -649,6 +649,12 @@ func shouldRetry(ctx context.Context, resp *http.Response, err error) (bool, err
|
||||||
retry := false
|
retry := false
|
||||||
if resp != nil {
|
if resp != nil {
|
||||||
switch resp.StatusCode {
|
switch resp.StatusCode {
|
||||||
|
case 400:
|
||||||
|
if apiErr, ok := err.(*api.Error); ok {
|
||||||
|
if apiErr.ErrorInfo.InnerError.Code == "pathIsTooLong" {
|
||||||
|
return false, fserrors.NoRetryError(err)
|
||||||
|
}
|
||||||
|
}
|
||||||
case 401:
|
case 401:
|
||||||
if len(resp.Header["Www-Authenticate"]) == 1 && strings.Index(resp.Header["Www-Authenticate"][0], "expired_token") >= 0 {
|
if len(resp.Header["Www-Authenticate"]) == 1 && strings.Index(resp.Header["Www-Authenticate"][0], "expired_token") >= 0 {
|
||||||
retry = true
|
retry = true
|
||||||
|
|
Loading…
Reference in a new issue